BLOB Storing Aliyun Provider

    • Install the ABP CLI if you haven’t installed before.
    • Open a command line (terminal) in the directory of the file you want to add the Volo.Abp.BlobStoring.Aliyun package.
    • Run abp add-package Volo.Abp.BlobStoring.Aliyun command.

    If you want to do it manually, install the NuGet package to your project and add [DependsOn(typeof(AbpBlobStoringAliyunModule))] to the ABP module class inside your project.

    Example: Configure to use the Aliyun storage provider by default

    • AccessKeyId ([NotNull]string): AccessKey is the key to access the Alibaba Cloud API. It has full permissions for the account. Please keep it safe! Recommend to follow ,Use RAM sub-user AccessKey to call API.
    • Endpoint ([NotNull]string): Endpoint is the external domain name of OSS. See the document for details.
    • UseSecurityTokenService (bool): Use to access OSS services,default: false.
    • RegionId (string): Access address of STS service. See the document for details.
    • RoleArn ([NotNull]string): STS required role ARN. See the for details.
    • RoleSessionName ([NotNull]string): Used to identify the temporary access credentials, it is recommended to use different application users to distinguish.
    • Policy (string): Additional permission restrictions. See the document for details.
    • DurationSeconds (int): Validity period(s) of a temporary access certificate,minimum is 900 and the maximum is 3600.
    • ContainerName (string): You can specify the container name in Aliyun. If this is not specified, it uses the name of the BLOB container defined with the attribute (see the ). Please note that Aliyun has some rules for naming containers. A container name must be a valid DNS name, conforming to the following naming rules:
      • Container names must start or end with a letter or number, and can contain only letters, numbers, and the dash (-) character.
      • Container names must be from 3 through 63 characters long.
    • CreateContainerIfNotExists (bool): Default value is false, If a container does not exist in Aliyun, AliyunBlobProvider will try to create it.
    • TemporaryCredentialsCacheKey (bool): The cache key of STS credentials.

    Aliyun Blob Provider organizes BLOB name and implements some conventions. The full name of a BLOB is determined by the following rules by default:

    • Appends host string if 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).
    • Appends tenants/<tenant-id> string if current tenant is not .
    • Appends the BLOB name.
    • AliyunBlobProvider is the main service that implements the Aliyun BLOB storage provider, if you want to override/replace it via (don’t replace IBlobProvider interface, but replace AliyunBlobProvider class).
    • IAliyunBlobNameCalculator is used to calculate the full BLOB name (that is explained above). It is implemented by the DefaultAliyunBlobNameCalculator by default.
    • is used create OSS client. It is implemented by the DefaultOssClientFactory by default. You can override/replace it,if you want customize.