@@ -107,6 +107,36 @@ UMBRACO__STORAGE__AZUREBLOB__MEDIA__CONTAINERNAME=sample-container
107
107
> ** Note**
108
108
> You still have to add the provider in the ` Program.cs ` file when not configuring the options in code.
109
109
110
+ ### Custom blob container options
111
+ To override the default blob container options, you can use the following extension methods on ` AzureBlobFileSystemOptions ` :
112
+ ``` csharp
113
+ // Add using default options (overly verbose, but shows how to revert back to the default)
114
+ .AddAzureBlobMediaFileSystem (options => options .CreateBlobContainerClientUsingDefault ())
115
+ // Add using options
116
+ .AddAzureBlobMediaFileSystem (options => options .CreateBlobContainerClientUsingOptions (_blobClientOptions ))
117
+ // If the connection string is parsed to a URI, use the delegate to create a BlobContainerClient
118
+ .AddAzureBlobMediaFileSystem (options => options .TryCreateBlobContainerClientUsingUri (uri => new BlobContainerClient (uri , _blobClientOptions )))
119
+ ```
120
+
121
+ This can also be used together with the ` Azure.Identity ` package to authenticate with Azure AD (using managed identities):
122
+ ``` csharp
123
+ using Azure .Identity ;
124
+ using Azure .Storage .Blobs ;
125
+ using Umbraco .Cms .Core .Composing ;
126
+ using Umbraco .StorageProviders .AzureBlob .IO ;
127
+
128
+ internal sealed class AzureBlobFileSystemComposer : IComposer
129
+ {
130
+ public void Compose (IUmbracoBuilder builder )
131
+ => builder .AddAzureBlobMediaFileSystem (options =>
132
+ {
133
+ options .ConnectionString = " https://[storage-account].blob.core.windows.net" ;
134
+ options .ContainerName = " media" ;
135
+ options .TryCreateBlobContainerClientUsingUri (uri => new BlobContainerClient (uri , new DefaultAzureCredential ()));
136
+ });
137
+ }
138
+ ```
139
+
110
140
## Umbraco.StorageProviders.AzureBlob.ImageSharp
111
141
Adds ImageSharp support for storing the image cache to a pre-configured Azure Blob Storage provider.
112
142
0 commit comments