I am using the azure blob storage module and when I upload image on blob, it creates the host name folder on the blob container. I don't want to create the host folder and want to use my path without the host folder. I set multi tenancy false but still it is pointing to host folder.
Here is my configuration in module
var configuration = context.Services.GetConfiguration();
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.Configure<CategoryBlobContainer>(container =>
{
container.IsMultiTenant = false;
container.UseAzure(azure =>
{
azure.ConnectionString = configuration["BlobStoring:Containers:AzureContainer:Configuration:ConnectionString"];
azure.ContainerName = configuration["BlobStoring:Containers:AzureContainer:Configuration:ContainerName"];
azure.CreateContainerIfNotExists = true;
});
});
});
I have one .net core web api project which is not abp solution but I want to use the blob storing module with this project. I have created one module in the project as below.
[DependsOn(typeof(NxPBlobStoringAwsModule))]
public class NxPAipModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
//context.Services.AddAutoMapperObjectMapper<>();
base.PreConfigureServices(context);
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.Configure<DocumentBlobContainer>(container =>
{
container.UseAws(Aws =>
{
Aws.Region = "eu-west-2";
Aws.CreateContainerIfNotExists = true;
Aws.UseClientSideEncryption = false;
Aws.AccessKeyId = "";
Aws.SecretAccessKey= "";
Aws.ContainerName = "nxp-staging-1";
});
});
});
}
}
and create the intance of NxPApiModule in program.cs file as below.
using (var application = AbpApplicationFactory.Create<ChurchAipModule>(options =>
{
options.UseAutofac();
}))
This is my NxPBlobStoringAwsModule
[DependsOn(typeof(AbpBlobStoringModule),
typeof(AbpCachingModule),
typeof(AbpAutofacModule))]
public class NxPBlobStoringAwsModule : AbpModule
{
}
When I run the project, I am getting below exception on application build.
1[Church.Api.DocumentBlobContainer]': Unable to resolve service for type 'Volo.Abp.BlobStoring.IBlobContainerFactory' while attempting to activate 'Volo.Abp.BlobStoring.BlobContainer1[Church.Api.DocumentBlobContainer]'.) (Error while validating the service descriptor 'ServiceType: Church.Api.Services.IShipmentAppService Lifetime: Transient ImplementationType: Church.Api.Services.ShipmentAppService':