diff --git a/FluentStorage.Azure.Blobs/Factory.cs b/FluentStorage.Azure.Blobs/Factory.cs index 5e04d16..fdaf946 100644 --- a/FluentStorage.Azure.Blobs/Factory.cs +++ b/FluentStorage.Azure.Blobs/Factory.cs @@ -19,6 +19,27 @@ public static IModulesFactory UseAzureBlobStorage(this IModulesFactory factory) return factory.Use(new Module()); } + /// + /// Creates Azure Blob Storage from an existing . + /// + public static IAzureBlobStorage AzureBlobStorage(this IBlobStorageFactory factory, + BlobServiceClient blobServiceClient) { + return AzureBlobStorage(factory, blobServiceClient, null); + } + + /// + /// Creates Azure Blob Storage from an existing . + /// + public static IAzureBlobStorage AzureBlobStorage(this IBlobStorageFactory factory, + BlobServiceClient blobServiceClient, + string containerName) { + if (blobServiceClient is null) { + throw new ArgumentNullException(nameof(blobServiceClient)); + } + + return new AzureBlobStorage(blobServiceClient, blobServiceClient.AccountName, containerName: containerName); + } + /// /// Connect to local emulator ///