AddAzureBlobMediaFileSystem(options => options.CreateBlobContainerClientUsingDefault()) - this is overly verbose to add by default, but allows users to reset any customizations back to the default factory (that uses the ConnectionString and ContainerName);
AddAzureBlobMediaFileSystem(options => options.CreateBlobContainerClientUsingOptions(_blobClientOptions)) - this is similar to the default factory, but uses custom a BlobClientOptions (allowing you to e.g. configure retry policies);
AddAzureBlobMediaFileSystem(options => options.TryCreateBlobContainerClientUsingUri(uri => new BlobContainerClient(uri, _blobClientOptions))) - if the ConnectionString can be parsed into a valid URI, this factory will be used, otherwise it will fall back to the previous set/default one.
The TryCreateBlobContainerClientUsingUri() can be used to provide a DefaultAzureCredential instance (after adding the Azure.Identity package) to enable access using managed identities.
This fixes https://github.com/umbraco/Umbraco.StorageProviders/issues/43 by allowing users to customize the way the
BlobContainerClient
is created from theAzureBlobFileSystemOptions
using:AddAzureBlobMediaFileSystem(options => options.CreateBlobContainerClientUsingDefault())
- this is overly verbose to add by default, but allows users to reset any customizations back to the default factory (that uses theConnectionString
andContainerName
);AddAzureBlobMediaFileSystem(options => options.CreateBlobContainerClientUsingOptions(_blobClientOptions))
- this is similar to the default factory, but uses custom aBlobClientOptions
(allowing you to e.g. configure retry policies);AddAzureBlobMediaFileSystem(options => options.TryCreateBlobContainerClientUsingUri(uri => new BlobContainerClient(uri, _blobClientOptions)))
- if theConnectionString
can be parsed into a valid URI, this factory will be used, otherwise it will fall back to the previous set/default one.The
TryCreateBlobContainerClientUsingUri()
can be used to provide aDefaultAzureCredential
instance (after adding theAzure.Identity
package) to enable access using managed identities.