@@ -10,28 +10,29 @@ namespace Umbraco.Cloud.StorageProviders.AzureBlob
10
10
/// Automatically configures Azure Blob Storage for use on Umbraco Cloud.
11
11
/// </summary>
12
12
/// <seealso cref="Umbraco.Cms.Core.Composing.IComposer" />
13
- public class AzureBlobComposer : IComposer
13
+ public sealed class AzureBlobComposer : IComposer
14
14
{
15
15
/// <inheritdoc />
16
16
public void Compose ( IUmbracoBuilder builder )
17
17
{
18
- if ( builder == null ) throw new ArgumentNullException ( nameof ( builder ) ) ;
18
+ ArgumentNullException . ThrowIfNull ( builder ) ;
19
19
20
- /* There's a bug in Microsoft.Extensions.Configuration.EnvironmentVariables @ 6.0.0 WRT env var normalization + AddEnvironmentVariables(prefix)
21
- * See https://github.com/dotnet/runtime/pull/62916, should be resolved upstream in https://github.com/dotnet/runtime/milestone/87
22
- * Until then, safest thing to do is explicitly add environment variables using both prefixes.
23
- * (otherwise there are issues when folks update TFM to net6) */
24
20
var configuration = new ConfigurationBuilder ( )
25
21
. AddEnvironmentVariables ( "Umbraco:Cloud:" )
26
- . AddEnvironmentVariables ( "Umbraco__Cloud__" )
27
22
. Build ( ) ;
28
23
29
24
// Get options and manually validate (no need to add them to the service collection)
30
25
var azureBlobOptions = configuration . GetSection ( "Storage:AzureBlob" ) . Get < AzureBlobOptions > ( ) ;
31
- if ( azureBlobOptions == null ) return ;
26
+ if ( azureBlobOptions == null )
27
+ {
28
+ return ;
29
+ }
32
30
33
31
var validateResult = new DataAnnotationValidateOptions < AzureBlobOptions > ( null ) . Validate ( null , azureBlobOptions ) ;
34
- if ( validateResult . Failed ) return ;
32
+ if ( validateResult . Failed )
33
+ {
34
+ return ;
35
+ }
35
36
36
37
// Configure Azure Blob Storage
37
38
builder . AddAzureBlobMediaFileSystem ( options =>
0 commit comments