docs/en/framework/infrastructure/blob-storing/azure.md
//[doc-seo]
{
"Description": "Learn how to configure Azure Blob storage for your project using the ABP Framework with this concise guide on the BLOB Storing Azure Provider."
}
BLOB Storing Azure Provider can store BLOBs in Azure Blob storage.
Read the BLOB Storing document to understand how to use the BLOB storing system. This document only covers how to configure containers to use a Azure BLOB as the storage provider.
Use the ABP CLI to add Volo.Abp.BlobStoring.Azure NuGet package to your project:
.csproj file you want to add the Volo.Abp.BlobStoring.Azure package.abp add-package Volo.Abp.BlobStoring.Azure command.If you want to do it manually, install the Volo.Abp.BlobStoring.Azure NuGet package to your project and add [DependsOn(typeof(AbpBlobStoringAzureModule))] to the ABP module class inside your project.
Configuration is done in the ConfigureServices method of your module class, as explained in the BLOB Storing document.
Example: Configure to use the azure storage provider by default
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureDefault(container =>
{
container.UseAzure(azure =>
{
azure.ConnectionString = "your azure connection string";
azure.ContainerName = "your azure container name";
azure.CreateContainerIfNotExists = true;
});
});
});
See the BLOB Storing document to learn how to configure this provider for a specific container.
BlobContainerName attribute (see the BLOB storing document). Please note that Azure has some rules for naming containers. A container name must be a valid DNS name, conforming to the following naming rules:
false, If a container does not exist in azure, AzureBlobProvider will try to create it.Azure Blob Provider organizes BLOB name and implements some conventions. The full name of a BLOB is determined by the following rules by default:
host string if current tenant is null (or multi-tenancy is disabled for the container - see the BLOB Storing document to learn how to disable multi-tenancy for a container).tenants/<tenant-id> string if current tenant is not null.AzureBlobProvider is the main service that implements the Azure BLOB storage provider, if you want to override/replace it via dependency injection (don't replace IBlobProvider interface, but replace AzureBlobProvider class).IAzureBlobNameCalculator is used to calculate the full BLOB name (that is explained above). It is implemented by the DefaultAzureBlobNameCalculator by default.