### Azure Service Bus Receiver Setup Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Service-Bus This section describes how to create receivers for Azure Service Bus topics and queues using the FluentStorage provider. ```APIDOC ## Azure Service Bus Receiver Setup ### Description This section describes how to create receivers for Azure Service Bus topics and queues using the FluentStorage provider. Optional parameters can be provided to fine-tune the Service Bus client and processor options. ### Methods - **AzureServiceBusTopicReceiver()** - Creates an Azure Service Bus Receiver for topics and subscriptions. - **AzureServiceBusQueueReceiver()** - Creates an Azure Service Bus Receiver for queues. ### Parameters - **serviceBusClientOptions** (ServiceBusClientOptions) - Optional - Options for the Service Bus client. - **serviceBusProcessorOptions** (ServiceBusProcessorOptions) - Optional - Options for the Service Bus processor. ### Resources - [ServiceBusClientOptions docs](https://learn.microsoft.com/en-us/dotnet/api/azure.messaging.servicebus.servicebusclientoptions?view=azure-dotnet) - [ServiceBusProcessorOptions docs](https://learn.microsoft.com/en-us/dotnet/api/azure.messaging.servicebus.servicebusprocessoroptions?view=azure-dotnet) ``` -------------------------------- ### Initialize Azure Queue Storage Publisher and Receiver Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Queue-Storage Use this to get an IMessagePublisher and IMessageReceiver for Azure Queue Storage when default configurations are available. ```csharp IMessagePublisher publisher = StorageFactory.Messages.AzureStorageQueuePublisher(); IMessageReceiver receiver = StorageFactory.Messages.AzureStorageQueueReceiver(); ``` -------------------------------- ### Start Message Pump Interface Source: https://github.com/robinrodricks/fluentstorage/wiki/Message-Storage The primary method for receiving messages, allowing for batch processing and cancellation support. ```csharp Task StartMessagePumpAsync( Func, Task> onMessageAsync, int maxBatchSize = 1, CancellationToken cancellationToken = default); ``` -------------------------------- ### Create AWS SQS Message Publisher and Receiver Source: https://github.com/robinrodricks/fluentstorage/wiki/AWS-SQS Use these methods to construct an IMessagePublisher for sending messages to an SQS queue or an IMessageReceiver for receiving messages. Ensure you have the FluentStorage.AWS NuGet package installed. ```csharp IMessagePublisher queuePublisher = StorageFactory.Messages.AmazonSQSMessagePublisher( accessKeyId, secretAccessKey, serviceUrl, queueName, regionEndpoint); IMessagePublisher topicPublisher = StorageFactory.Messages.AmazonSQSMessageReceiver( accessKeyId, secretAccessKey, serviceUrl, queueName, regionEndpoint); ``` -------------------------------- ### Connect via Connection String Source: https://github.com/robinrodricks/fluentstorage/wiki/SFTP-Storage Shows how to register the SFTP module and initialize storage using a connection string. ```csharp IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("sftp://host=hostname;user=username;password=password"); ``` -------------------------------- ### Connect to SFTP Server Source: https://github.com/robinrodricks/fluentstorage/wiki/SFTP-Storage Demonstrates various ways to instantiate an SFTP storage client, including basic credentials, custom ports with private keys, and full ConnectionInfo objects. ```csharp IBlobStorage storage = StorageFactory.Blobs.Sftp("myhost.com", "username", "password"); // With a custom port and a private key file IBlobStorage storage = StorageFactory.Blobs.Sftp("myhost.com", 2222, "username", new PrivateKeyFile("filename")); // With both password and public-key authentication as an example, real world scenarios may need extra customisations var connectionInfo = new ConnectionInfo("sftp.foo.com", "guest", new PasswordAuthenticationMethod("guest", "pwd"), new PrivateKeyAuthenticationMethod("rsa.key")); IBlobStorage storage = StorageFactory.Blobs.Sftp(connectionInfo); ``` -------------------------------- ### Connect to FTP Server with Basic Credentials Source: https://github.com/robinrodricks/fluentstorage/wiki/FTP-Storage Instantiate an FTP blob storage client using hostname, username, and password. Ensure the FluentStorage.FTP NuGet package is referenced. ```csharp IBlobStorage storage = StorageFactory.Blobs.Ftp("myhost.com", new NetworkCredential("username", "password")); ``` -------------------------------- ### Initialize Blob Storage via Connection Strings Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Configure storage providers using connection strings after registering the required modules at application startup. ```csharp using FluentStorage; using FluentStorage.Blobs; // Register provider modules at application startup StorageFactory.Modules.UseAwsStorage(); StorageFactory.Modules.UseAzureBlobStorage(); StorageFactory.Modules.UseGoogleCloudStorage(); StorageFactory.Modules.UseFtpStorage(); StorageFactory.Modules.UseSftpStorage(); // Create storage from connection strings IBlobStorage inMemory = StorageFactory.Blobs.FromConnectionString("inmemory://"); IBlobStorage localDisk = StorageFactory.Blobs.FromConnectionString("disk://path=/data/storage"); IBlobStorage zipFile = StorageFactory.Blobs.FromConnectionString("zip://path=/archive.zip"); IBlobStorage awsS3 = StorageFactory.Blobs.FromConnectionString( "aws.s3://keyId=AKIAIOSFODNN7EXAMPLE;key=secretkey;bucket=my-bucket;region=us-east-1"); IBlobStorage azureBlob = StorageFactory.Blobs.FromConnectionString( "azure.blob://account=mystorageaccount;key=base64key=="); IBlobStorage azureFiles = StorageFactory.Blobs.FromConnectionString( "azure.file://account=mystorageaccount;key=base64key=="); IBlobStorage googleCloud = StorageFactory.Blobs.FromConnectionString( "google.storage://bucket=my-bucket;cred=base64encodedcredentials"); IBlobStorage ftp = StorageFactory.Blobs.FromConnectionString( "ftp://host=ftp.example.com;user=username;password=secret"); IBlobStorage sftp = StorageFactory.Blobs.FromConnectionString( "sftp://host=sftp.example.com;user=username;password=secret"); ``` -------------------------------- ### Get Read-Only Blob SAS URL Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Blob-Storage Generates a read-only SAS URL for a blob that is valid for 1 hour. Use this when you need to provide temporary download access to a blob. ```csharp string publicUrl = await _native.GetBlobSasAsync(path); ``` -------------------------------- ### Get Custom Blob SAS URL Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Blob-Storage Generates a SAS URL with custom permissions and duration. Pass a BlobSasPolicy object to specify permissions like read/write and the desired validity period. ```csharp var policy = new BlobSasPolicy(TimeSpan.FromHours(12)) { Permissions = BlobSasPermission.Read | BlobSasPermission.Write }; string publicUrl = await _native.GetBlobSasAsync(path, policy); ``` -------------------------------- ### List Blobs and Folders with IBlobStorage.ListAsync Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Demonstrates listing blobs and folders using IBlobStorage.ListAsync with options for filtering, recursion, and pagination. Requires FluentStorage and FluentStorage.Blobs namespaces. ```csharp using FluentStorage; using FluentStorage.Blobs; IBlobStorage storage = StorageFactory.Blobs.InMemory(); // Create test structure await storage.WriteTextAsync("documents/report.pdf", "PDF content"); await storage.WriteTextAsync("documents/2024/january.txt", "January data"); await storage.WriteTextAsync("documents/2024/february.txt", "February data"); await storage.WriteTextAsync("images/photo.jpg", "Image data"); // List all items in root IReadOnlyCollection rootItems = await storage.ListAsync(); foreach (Blob blob in rootItems) { Console.WriteLine($"{(blob.IsFolder ? "Folder" : "File")}: {blob.FullPath}"); } // List items in a specific folder IReadOnlyCollection docs = await storage.ListAsync(folderPath: "documents"); // List with recursion (all nested items) IReadOnlyCollection allItems = await storage.ListAsync( folderPath: "documents", recurse: true); // List with options object for advanced control var options = new ListOptions { FolderPath = "documents", Recurse = true, MaxResults = 100, FilePrefix = "report", // Filter by prefix IncludeAttributes = true // Include metadata }; IReadOnlyCollection filtered = await storage.ListAsync(options); // List only files (exclude folders) IReadOnlyCollection filesOnly = await storage.ListFilesAsync( new ListOptions { FolderPath = "documents", Recurse = true }); // Filter with custom predicate IReadOnlyCollection txtFiles = await storage.ListAsync( folderPath: "documents", browseFilter: blob => blob.Name.EndsWith(".txt"), recurse: true); // Pagination support var pageOptions = new ListOptions { FolderPath = "documents", MaxResults = 10, PageSize = 100 // Internal page size for provider calls }; IReadOnlyCollection page = await storage.ListAsync(pageOptions); ``` -------------------------------- ### Initialize Azure File Shares Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Blob-Storage Create an Azure file share instance using account credentials or a connection string. ```csharp IBlobStorage storage = StorageFactory.Blobs.AzureFiles(accountName, accountKey); ``` ```csharp IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("azure.file://account=account_name;key=secret_value"); ``` -------------------------------- ### Get ADLS Gen 2 Object Permissions Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Data-Lake Retrieves the Access Control List (ACL) for a specified path on ADLS Gen 2 storage. Requires casting the IBlobStorage to IAzureDataLakeGen2BlobStorage. ```csharp IBlobStorage genericStorage = StorageFactory.Blobs.AzureDataLakeGen2StoreByClientSecret(name, key); IAzureDataLakeGen2BlobStorage gen2Storage = (IAzureDataLakeGen2BlobStorage)genericStorage; //get permissions AccessControl access = await _storage.GetAccessControlAsync(path); ``` -------------------------------- ### Basic Blob Storage Operations with Streams Source: https://github.com/robinrodricks/fluentstorage/wiki/Blob-Storage Demonstrates creating an Azure Blob Storage instance, uploading content using a MemoryStream, and reading it back. Requires referencing the appropriate NuGet package. ```csharp using FluentStorage; using FluentStorage.Blobs; using System.IO; using System.Text; namespace Scenario { public class DocumentationScenarios { public async Task RunAsync() { //create the storage using a factory method IBlobStorage storage = StorageFactory.Blobs.AzureBlobStorageWithSharedKey( "storage name", "storage key"); //upload it string content = "test content"; using (var s = new MemoryStream(Encoding.UTF8.GetBytes(content))) { await storage.WriteAsync("mycontainer/someid", s); } //read back using (var s = new MemoryStream()) { using (Stream ss = await storage.OpenReadAsync("mycontainer/someid")) { await ss.CopyToAsync(s); //content is now "test content" content = Encoding.UTF8.GetString(s.ToArray()); } } } } } ``` -------------------------------- ### Initialize Blob Storage via Factory Methods Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Create instances of various storage providers using the StorageFactory.Blobs class. Each provider requires its specific NuGet package. ```csharp using FluentStorage; using FluentStorage.Blobs; // In-Memory storage (built-in, useful for testing) IBlobStorage memoryStorage = StorageFactory.Blobs.InMemory(); // Local disk storage (built-in) IBlobStorage diskStorage = StorageFactory.Blobs.DirectoryFiles(new DirectoryInfo("/data/storage")); // ZIP file storage (built-in) IBlobStorage zipStorage = StorageFactory.Blobs.ZipFile("/path/to/archive.zip"); // AWS S3 (requires FluentStorage.AWS package) IBlobStorage s3Storage = StorageFactory.Blobs.AwsS3( accessKeyId: "AKIAIOSFODNN7EXAMPLE", secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", sessionToken: null, bucketName: "my-bucket", region: Amazon.RegionEndpoint.USEast1); // Azure Blob Storage (requires FluentStorage.Azure.Blobs package) IBlobStorage azureStorage = StorageFactory.Blobs.AzureBlobStorageWithSharedKey( accountName: "mystorageaccount", accountKey: "base64encodedkey=="); // Google Cloud Storage (requires FluentStorage.GCP package) IBlobStorage gcpStorage = StorageFactory.Blobs.GoogleCloudStorageFromJsonFile( bucketName: "my-gcp-bucket", credentialsFilePath: "/path/to/credentials.json"); // FTP Storage (requires FluentStorage.FTP package) IBlobStorage ftpStorage = StorageFactory.Blobs.Ftp( hostNameOrAddress: "ftp.example.com", credentials: new NetworkCredential("username", "password")); // SFTP Storage (requires FluentStorage.SFTP package) IBlobStorage sftpStorage = StorageFactory.Blobs.Sftp( host: "sftp.example.com", username: "user", password: "password"); ``` -------------------------------- ### Set ADLS Gen 2 Object Permissions Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Data-Lake Sets or updates the Access Control List (ACL) for a specified path on ADLS Gen 2 storage. This example demonstrates adding write access for a user. ```csharp // add user to custom ACL access.Acl.Add(new AclEntry(ObjectType.User, userId, false, true, false)); //update the ACL on Gen 2 storage await _storage.SetAccessControlAsync(path, access); ``` -------------------------------- ### Initialize Google Cloud Storage Module Source: https://github.com/robinrodricks/fluentstorage/wiki/Google-Cloud-Storage Before using Google Cloud Storage with FluentStorage, you must initialize the module. This sets up the necessary components for GCS operations. ```csharp StorageFactory.Modules.UseGoogleCloudStorage(); ``` -------------------------------- ### Apply Data Transformation to Blob Storage Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Demonstrates how to wrap base storage with GZip compression and AES symmetric encryption decorators. Transformations are applied transparently during read and write operations. ```csharp using FluentStorage; using FluentStorage.Blobs; // Create base storage IBlobStorage baseStorage = StorageFactory.Blobs.DirectoryFiles(new DirectoryInfo("/data")); // Add GZip compression (data compressed on write, decompressed on read) IBlobStorage gzipStorage = baseStorage.WithGzipCompression(); // Write compressed data (automatically gzipped) await gzipStorage.WriteTextAsync("logs/application.log", "Large log content that will be compressed..."); // Read compressed data (automatically decompressed) string logContent = await gzipStorage.ReadTextAsync("logs/application.log"); // Add AES symmetric encryption IBlobStorage encryptedStorage = StorageFactory.Blobs .DirectoryFiles(new DirectoryInfo("/secure")) .WithAesSymmetricEncryption( encryptionKey: "your-32-byte-base64-encoded-key==", encryptionSecret: "your-16-byte-iv-base64=="); // Write encrypted data await encryptedStorage.WriteTextAsync("secrets/credentials.json", "{\"username\": \"admin\", \"password\": \"secret\"}"); // Read and decrypt data string credentials = await encryptedStorage.ReadTextAsync("secrets/credentials.json"); // Chain multiple transformations (compress then encrypt) IBlobStorage secureCompressedStorage = StorageFactory.Blobs .AzureBlobStorageWithSharedKey("account", "key") .WithGzipCompression() .WithAesSymmetricEncryption("key==", "iv=="); // Legacy Rijndael encryption (obsolete in .NET 6+) // IBlobStorage rijndaelStorage = baseStorage.WithSymmetricEncryption("key", "secret"); ``` -------------------------------- ### Connect to MinIO via Connection String Source: https://github.com/robinrodricks/fluentstorage/wiki/MinIO-Storage Connect to MinIO using a formatted connection string after initializing the AWS module. ```csharp IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("minio.s3://keyId=...;key=...;bucket=...;region=..."); ``` -------------------------------- ### Initialize Azure Blob Storage Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Blob-Storage Create Azure Blob Storage instances using various authentication methods and configurations. ```csharp //create from account name and key (secret) IBlobStorage storage = StorageFactory.Blobs.AzureBlobStorageWithSharedKey(accountName, accountKey); //create to use local development storage emulator IBlobStorage storage = StorageFactory.Blobs.AzureBlobStorageWithLocalEmulator(); //create an instance of Microsoft Azure Blob Storage that wraps around native CloudBlobClient IBlobStorage storage = StorageFactory.Blobs.AzureBlobStorage(client); ``` ```csharp //using account name and key IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("azure.blob://account=account_name;key=secret_value"); //local development emulator IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("azure.blob://development=true"); ``` -------------------------------- ### Connect to FTP Server with Custom FluentFTP Client Source: https://github.com/robinrodricks/fluentstorage/wiki/FTP-Storage Integrate a pre-configured FtpClient from the FluentFTP library with FluentStorage. This allows for custom configurations like specifying a non-standard port. ```csharp var client = new FtpClient("myhost.com", 12345, new NetworkCredential("username", "password")); IBlobStorage storage = StorageFactory.Blobs.FtpFromFluentFtpClient(client); ``` -------------------------------- ### Initialize Azure Queue Storage with Connection String Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Queue-Storage Initialize an IMessagePublisher and IMessageReceiver for Azure Queue Storage using a provided connection string. ```csharp IMessagePublisher publisher = StorageFactory.Messages.PublisherFromConnectionString("azure.queue://account=...;key=...;queue=..."); IMessageReceiver receiver = StorageFactory.Messages.ReceiverFromConnectionString("azure.queue://account=..;key=...;queue=..."); ``` -------------------------------- ### Connect to MinIO Source: https://github.com/robinrodricks/fluentstorage/wiki/MinIO-Storage Connects to MinIO storage servers (S3 compatible) using the MinIO method. Requires the FluentStorage.AWS NuGet package. ```APIDOC ## Connect to MinIO ### Description Connects to MinIO storage servers (S3 compatible) using the `MinIO` method. Requires the `FluentStorage.AWS` NuGet package. ### Method ```csharp StorageFactory.Blobs.MinIO( string accessKeyId, string secretAccessKey, string bucketName, string awsRegion, string minioServerUrl ); ``` ### Endpoint N/A (This is a client-side connection method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp IBlobStorage storage = StorageFactory.Blobs.MinIO( accessKeyId, secretAccessKey, bucketName, awsRegion, minioServerUrl ); ``` ### Response #### Success Response (200) Returns an `IBlobStorage` instance configured for MinIO. #### Response Example N/A (Client-side object creation) ``` -------------------------------- ### Create Azure Blob Storage with Connection String Source: https://github.com/robinrodricks/fluentstorage/wiki/Blob-Storage Instantiate an Azure Blob Storage provider using a connection string. This method abstracts the underlying implementation details. ```csharp IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("azure.blobs://...parameters..."); ``` -------------------------------- ### Create Messaging Instances with StorageFactory Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Initializes various messaging backends including in-memory, local disk, AWS SQS, Azure Service Bus, and Azure Storage Queues. ```csharp using FluentStorage; using FluentStorage.Messaging; // In-Memory messenger (built-in, useful for testing) IMessenger memoryMessenger = StorageFactory.Messages.InMemory("test-queue"); // Local disk messenger (built-in) IMessenger diskMessenger = StorageFactory.Messages.Disk("/data/queues"); // AWS SQS (requires FluentStorage.AWS package) IMessenger sqsMessenger = StorageFactory.Messages.AwsSQS( accessKeyId: "AKIAIOSFODNN7EXAMPLE", secretAccessKey: "secretkey", serviceUrl: "https://sqs.us-east-1.amazonaws.com", queueName: "my-queue", regionEndpoint: Amazon.RegionEndpoint.USEast1); // Azure Service Bus (requires FluentStorage.Azure.ServiceBus package) IMessenger serviceBusMessenger = StorageFactory.Messages.AzureServiceBus( connectionString: "Endpoint=sb://mynamespace.servicebus.windows.net/;SharedAccessKeyName=..."); // Azure Storage Queue (requires FluentStorage.Azure.Queues package) IMessenger azureQueueMessenger = StorageFactory.Messages.AzureStorageQueue( accountName: "mystorageaccount", accountKey: "base64key=="); // From connection string IMessenger diskFromCs = StorageFactory.Messages.MessengerFromConnectionString("disk://path=/data/queues"); ``` -------------------------------- ### Connect to FTP Server using Connection String Source: https://github.com/robinrodricks/fluentstorage/wiki/FTP-Storage Create an FTP blob storage client from a connection string after registering the FTP storage module. The connection string format is ftp://host=hostname;user=username;password=password. ```csharp IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("ftp://host=hostname;user=username;password=password"); ``` -------------------------------- ### Manage and Interact with Queues using IMessenger Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Demonstrates creating channels, sending messages with properties, receiving messages with visibility timeouts, and peeking at queue contents. ```csharp using FluentStorage; using FluentStorage.Messaging; IMessenger messenger = StorageFactory.Messages.InMemory("orders"); // Create a channel (queue) await messenger.CreateChannelsAsync(new[] { "orders", "notifications" }); // List available channels IReadOnlyCollection channels = await messenger.ListChannelsAsync(); // Send a single message var orderMessage = new QueueMessage("order-001", "{\"product\": \"Widget\", \"quantity\": 5}"); orderMessage.Properties["Priority"] = "High"; orderMessage.Properties["CustomerId"] = "CUST-123"; await messenger.SendAsync("orders", new[] { orderMessage }); // Send multiple messages var messages = new List { new QueueMessage("Order 1 content"), new QueueMessage("Order 2 content"), QueueMessage.FromText("Order 3 content") }; await messenger.SendAsync("orders", messages); // Receive messages (removes from queue) IReadOnlyCollection received = await messenger.ReceiveAsync( channelName: "orders", count: 10, visibility: TimeSpan.FromMinutes(5)); // Hide messages for 5 minutes foreach (QueueMessage msg in received) { Console.WriteLine($"ID: {msg.Id}"); Console.WriteLine($"Content: {msg.StringContent}"); Console.WriteLine($"Dequeue Count: {msg.DequeueCount}"); // Process message... // Delete after successful processing await messenger.DeleteAsync("orders", new[] { msg }); } // Peek messages (view without removing) IReadOnlyCollection peeked = await messenger.PeekAsync("orders", count: 5); // Get message count long count = await messenger.GetMessageCountAsync("orders"); // Delete channel await messenger.DeleteChannelsAsync(new[] { "old-queue" }); ``` -------------------------------- ### Chain Multiple Sinks for Transformations Source: https://github.com/robinrodricks/fluentstorage/wiki/Custom-Sinks Demonstrates chaining multiple sinks, such as GZipSink and SymmetricEncryptionSink, to perform sequential data transformations. The order of declaration matters for write operations. ```csharp IBlobStorage encryptedAndCompressed = StorageFactory.Blobs .InMemory() .WithSinks( new GZipSink(), new SymmetricEncryptionSink("To6X5XVaNNMKFfxssJS6biREGpOVZjEIC6T7cc1rJF0=")) ``` -------------------------------- ### Mount Multiple Providers with VirtualStorage Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Combine disparate storage providers into a single unified namespace by mounting them to specific virtual paths. Enables cross-provider operations like copying files. ```csharp using FluentStorage; using FluentStorage.Blobs; // Create individual storage providers IBlobStorage localStorage = StorageFactory.Blobs.DirectoryFiles(new DirectoryInfo("/data/local")); IBlobStorage s3Storage = StorageFactory.Blobs.AwsS3("keyId", "secretKey", null, "my-bucket"); IBlobStorage azureStorage = StorageFactory.Blobs.AzureBlobStorageWithSharedKey("account", "key"); // Create virtual storage and mount providers IVirtualStorage virtualStorage = StorageFactory.Blobs.Virtual(); virtualStorage.Mount("/local", localStorage); virtualStorage.Mount("/aws", s3Storage); virtualStorage.Mount("/azure", azureStorage); // Now use a single interface to access all providers // Write to local storage await virtualStorage.WriteTextAsync("/local/documents/report.txt", "Local report content"); // Write to AWS S3 await virtualStorage.WriteTextAsync("/aws/uploads/data.json", "{\"key\": \"value\"}"); // Write to Azure Blob Storage await virtualStorage.WriteTextAsync("/azure/backups/backup.sql", "SQL backup content"); // List across all mounted storages IReadOnlyCollection roots = await virtualStorage.ListAsync("/"); // Returns: local/, aws/, azure/ as folders // Read from any provider transparently string content = await virtualStorage.ReadTextAsync("/aws/uploads/data.json"); // Copy between providers using (Stream source = await virtualStorage.OpenReadAsync("/local/documents/report.txt")) { await virtualStorage.WriteAsync("/azure/archives/report.txt", source); } ``` -------------------------------- ### Connect to MinIO via Factory Method Source: https://github.com/robinrodricks/fluentstorage/wiki/MinIO-Storage Use the MinIO method to establish a connection to an S3-compatible MinIO server. ```csharp IBlobStorage storage = StorageFactory.Blobs.MinIO( accessKeyId, secretAccessKey, bucketName, awsRegion, minioServerUrl); ``` -------------------------------- ### Check and Delete Blobs with IBlobStorage.ExistsAsync and DeleteAsync Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Shows how to check for the existence of single or multiple blobs and how to delete blobs using IBlobStorage.ExistsAsync and DeleteAsync. Supports recursive deletion of folders. ```csharp using FluentStorage; using FluentStorage.Blobs; IBlobStorage storage = StorageFactory.Blobs.InMemory(); // Create test data await storage.WriteTextAsync("folder/file1.txt", "Content 1"); await storage.WriteTextAsync("folder/file2.txt", "Content 2"); await storage.WriteTextAsync("folder/subfolder/file3.txt", "Content 3"); // Check if single blob exists (extension method) bool exists = await storage.ExistsAsync("folder/file1.txt"); Console.WriteLine($"File exists: {exists}"); // Output: File exists: True // Check multiple blobs at once (core method) IReadOnlyCollection existsResults = await storage.ExistsAsync( new[] { "folder/file1.txt", "folder/missing.txt", "folder/file2.txt" }); // Results: [true, false, true] // Delete single blob (extension method) await storage.DeleteAsync("folder/file1.txt"); // Delete multiple blobs (core method) await storage.DeleteAsync(new[] { "folder/file2.txt", "folder/subfolder/file3.txt" }); // Delete folder recursively await storage.DeleteAsync("folder"); // Deletes folder and all contents // Safe delete pattern (check before delete) string path = "data/important.txt"; if (await storage.ExistsAsync(path)) { await storage.DeleteAsync(path); Console.WriteLine("File deleted successfully"); } ``` -------------------------------- ### Create and Use QueueMessage in C# Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Demonstrates creating QueueMessage instances from string or byte content, accessing properties, adding custom properties, and serializing/deserializing messages to byte arrays. ```csharp using FluentStorage.Messaging; // Create message from string content var textMessage = new QueueMessage("msg-001", "Order placed successfully"); // Create message from byte content byte[] binaryContent = new byte[] { 0x01, 0x02, 0x03 }; var binaryMessage = new QueueMessage("msg-002", binaryContent); // Create message with just content (ID auto-generated) var simpleMessage = new QueueMessage("Simple message content"); // Static factory method QueueMessage fromFactory = QueueMessage.FromText("Factory created message"); // Access message properties Console.WriteLine($"ID: {textMessage.Id}"); Console.WriteLine($"String Content: {textMessage.StringContent}"); Console.WriteLine($"Binary Content: {textMessage.Content?.Length} bytes"); Console.WriteLine($"Dequeue Count: {textMessage.DequeueCount}"); Console.WriteLine($"Next Visible: {textMessage.NextVisibleTime}"); // Add custom properties textMessage.Properties["CorrelationId"] = "COR-12345"; textMessage.Properties["ContentType"] = "application/json"; textMessage.Properties["Priority"] = "1"; // Binary serialization (for wire transfer) byte[] wireData = textMessage.ToByteArray(); // Deserialize from binary QueueMessage restored = QueueMessage.FromByteArray(wireData); Console.WriteLine($"Restored content: {restored.StringContent}"); Console.WriteLine($"Restored property: {restored.Properties["CorrelationId"]}"); // Clone a message QueueMessage cloned = textMessage.Clone(); ``` -------------------------------- ### Connect to Blob Storage Source: https://github.com/robinrodricks/fluentstorage/wiki/Getting-Started Use the factory methods provided by FluentStorage to construct storage classes for various blob storage providers. ```APIDOC ## Connect to Blob Storage To construct storage classes, you need to use the factory methods. ### StorageFactory.Blobs.FromConnectionString **Purpose**: Creates a blob storage instance from a connection string. ### StorageFactory.Blobs.DirectoryFiles **Purpose**: Creates a storage for a specific disk directory. ### StorageFactory.Blobs.InMemory **Purpose**: Creates a storage which stores everything in memory. ### StorageFactory.Blobs.Virtual **Purpose**: Creates a virtual storage where you can mount other storage providers to a specific virtual directory. ### StorageFactory.Blobs.AwsS3 **Purpose**: Creates an AWS S3 storage bucket or custom S3-compatible storage server. ### StorageFactory.Blobs.DigitalOceanSpaces **Purpose**: Creates a [DigitalOcean Spaces](https://www.digitalocean.com/products/spaces) storage (S3 compatible). ### StorageFactory.Blobs.MinIO **Purpose**: Creates a [MinIO](https://min.io/) storage server (S3 compatible). ### StorageFactory.Blobs.Wasabi **Purpose**: Creates a [Wasabi](https://wasabi.com/) storage (S3 compatible). ### StorageFactory.Blobs.GoogleCloudStorageFromEnvironmentVariable **Purpose**: Creates a Google Cloud Storage storage with credentials in environment variables. ### StorageFactory.Blobs.GoogleCloudStorageFromJsonFile **Purpose**: Creates a Google Cloud Storage storage with credentials in an external JSON. ### StorageFactory.Blobs.GoogleCloudStorageFromJson **Purpose**: Creates a Google Cloud Storage storage with credentials in a passed JSON string. ### StorageFactory.Blobs.AzureBlobStorageWithLocalEmulator **Purpose**: Creates Azure Blob Storage to connect to a local emulator. ### StorageFactory.Blobs.AzureBlobStorageWithSharedKey **Purpose**: Creates Azure Blob Storage with Shared key authentication. ### StorageFactory.Blobs.AzureBlobStorageWithAzureAd **Purpose**: Creates Azure Blob Storage with Azure ActiveDirectory (AAD) authentication. ### StorageFactory.Blobs.AzureBlobStorageWithTokenCredential **Purpose**: Creates Azure Blob Storage with token credentials. ### StorageFactory.Blobs.AzureBlobStorageWithSas **Purpose**: Creates Azure Blob Storage with SAS identity. ### StorageFactory.Blobs.AzureBlobStorageWithMsi **Purpose**: Creates Azure Blob Storage with Managed Identity. ### StorageFactory.Blobs.AzureDataLakeGen1StoreByClientSecret **Purpose**: Creates Azure Data Lake Gen 1 Store client. ``` -------------------------------- ### AWS CLI Profile Support Source: https://github.com/robinrodricks/fluentstorage/wiki/MinIO-Storage Connects to a MinIO bucket using credentials from the local AWS CLI credentials file. ```APIDOC ## AWS CLI Profile Support ### Description Connects to a MinIO bucket using credentials already configured in your local AWS CLI credentials file. Refer to the provided wiki link for detailed setup instructions. ### Method Refer to the FluentStorage documentation for specific methods related to AWS CLI profile support, typically involving `StorageFactory` configuration. ### Endpoint N/A (Client-side configuration) ### Parameters Refer to the [AWS CLI Profile Support wiki](https://github.com/robinrodricks/FluentStorage/wiki/AWS-S3-Storage#aws-cli-profile-support) for details on how to configure and use profiles. ### Request Example Refer to the [AWS CLI Profile Support wiki](https://github.com/robinrodricks/FluentStorage/wiki/AWS-S3-Storage#aws-cli-profile-support) for code examples. ### Response #### Success Response (200) Returns an `IBlobStorage` instance configured using AWS CLI profiles. #### Response Example N/A (Client-side object creation) ``` -------------------------------- ### Generate and Use SAS Tokens Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Blob-Storage Retrieve SAS URLs and initialize storage instances using those tokens. ```csharp string sasUrl = await _native.GetStorageSasAsync(policy, true); ``` ```csharp IBlobStorage sasInstance = StorageFactory.Blobs.AzureBlobStorageWithSas(sasUrl); ``` ```csharp string sasUrl = await _native.GetContainerSasAsync(containerName, policy, true); ``` ```csharp IBlobStorage sasInstance = StorageFactory.Blobs.AzureBlobStorageFromSas(sasUrl); ``` -------------------------------- ### Connect to AWS S3 using CLI Profile Source: https://github.com/robinrodricks/fluentstorage/wiki/AWS-S3-Storage Connect to an AWS S3 bucket using credentials from a specified AWS CLI profile. Requires the profile name, bucket name, and region. ```csharp IBlobStorage bs = StorageFactory.Blobs.AwsS3( "anotherProfile", "bucketName", "region"); ``` -------------------------------- ### Connect to GCS from Environment Variables Source: https://github.com/robinrodricks/fluentstorage/wiki/Google-Cloud-Storage Use this method when your Google Cloud credentials are set as environment variables. Ensure the environment is configured according to Google Cloud's authentication documentation. ```csharp IBlobStorage storage = StorageFactory.Blobs.GoogleCloudStorageFromEnvironmentVariable(bucketName); ``` -------------------------------- ### Connect to DigitalOcean Spaces Source: https://github.com/robinrodricks/fluentstorage/wiki/DigitalOcean-Spaces-Storage Use this method to establish a connection to DigitalOcean Spaces storage. Ensure you have the correct access key ID, secret access key, bucket name, and DigitalOcean region. ```csharp IBlobStorage storage = StorageFactory.Blobs.DigitalOceanSpaces( accessKeyId, secretAccessKey, bucketName, digitalOceanRegion); ``` -------------------------------- ### Connect to GCS from JSON Credentials File Source: https://github.com/robinrodricks/fluentstorage/wiki/Google-Cloud-Storage Connect to Google Cloud Storage using credentials stored in a local JSON file. Provide the bucket name and the full path to the credentials file. ```csharp IBlobStorage storage = StorageFactory.Blobs.GoogleCloudStorageFromJsonFile(bucketName, filePath); ``` -------------------------------- ### Create GZip Compression Extension Method Source: https://github.com/robinrodricks/fluentstorage/wiki/Custom-Sinks An extension method for IBlobStorage to easily add GZip compression using GZipSink with a configurable compression level. ```csharp public static IBlobStorage WithGzipCompression( this IBlobStorage blobStorage, CompressionLevel compressionLevel = CompressionLevel.Optimal) { return blobStorage.WithSinks(new GZipSink(compressionLevel)); } ``` -------------------------------- ### IBlobStorage.ListAsync - Listing Blobs and Folders Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Retrieves blobs and folders from storage with support for filtering, recursion, and pagination. ```APIDOC ## IBlobStorage.ListAsync ### Description Retrieves blobs and folders from storage with support for filtering, recursion, and pagination. ### Method GET (conceptual, actual implementation is asynchronous method call) ### Endpoint N/A (This is a method within an interface) ### Parameters #### Query Parameters - **folderPath** (string) - Optional - The path to the folder to list items from. - **recurse** (bool) - Optional - If true, lists all nested items recursively. - **MaxResults** (int) - Optional - The maximum number of results to return. - **PageSize** (int) - Optional - Internal page size for provider calls. - **FilePrefix** (string) - Optional - Filters results to items with this prefix. - **IncludeAttributes** (bool) - Optional - If true, includes metadata with the blob information. #### Request Body N/A ### Request Example ```csharp // List all items in root IReadOnlyCollection rootItems = await storage.ListAsync(); // List with options object for advanced control var options = new ListOptions { FolderPath = "documents", Recurse = true, MaxResults = 100, FilePrefix = "report", // Filter by prefix IncludeAttributes = true // Include metadata }; IReadOnlyCollection filtered = await storage.ListAsync(options); // Filter with custom predicate IReadOnlyCollection txtFiles = await storage.ListAsync( folderPath: "documents", browseFilter: blob => blob.Name.EndsWith(".txt"), recurse: true); ``` ### Response #### Success Response (200) - **IReadOnlyCollection** - A collection of Blob objects representing the items found. #### Response Example ```json [ { "Name": "report.pdf", "FullPath": "documents/report.pdf", "IsFolder": false, "Length": 12, "LastModified": "2023-10-27T10:00:00Z" }, { "Name": "documents", "FullPath": "documents", "IsFolder": true, "Length": 0, "LastModified": "2023-10-27T10:00:00Z" } ] ``` ``` -------------------------------- ### Create Azure Data Lake Gen 1 Storage from Connection String Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Data-Lake Instantiate an IBlobStorage for Azure Data Lake Gen 1 using a connection string. The listBatchSize is optional and defaults to 5000. ```csharp IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("azure.datalake.gen1://account=...;tenantId=...;principalId=...;principalSecret=...;listBatchSize=...") ``` -------------------------------- ### Create Local Disk Blob Storage Source: https://github.com/robinrodricks/fluentstorage/wiki/Standard-Storage Maps a local folder to an IBlobStorage instance. The directory will be created on any write operation if it does not exist. Use for replicating directory structure as a blob storage interface. ```csharp IBlobStorage storage = StorageFactory.Blobs.DirectoryFiles(directory); ``` ```csharp IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("disk://path=path_to_directory"); ``` -------------------------------- ### Implement Message Processing with IMessageProcessor Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Shows how to implement the IMessageProcessor interface for automated message pumping and how to perform manual polling with a callback loop. ```csharp using FluentStorage; using FluentStorage.Messaging; // Define a message processor public class OrderProcessor : IMessageProcessor { public async Task ProcessMessagesAsync(IReadOnlyCollection messages) { foreach (QueueMessage message in messages) { Console.WriteLine($"Processing order: {message.StringContent}"); // Simulate processing await Task.Delay(100); } } } // Start the message processor IMessenger messenger = StorageFactory.Messages.InMemory("orders"); await messenger.CreateChannelsAsync(new[] { "orders" }); var processor = new OrderProcessor(); await messenger.StartMessageProcessorAsync("orders", processor); // Alternative: Use IMessageReceiver with callback public async Task ProcessWithCallback(CancellationToken cancellationToken) { IMessenger messenger = StorageFactory.Messages.InMemory("orders"); // Continuous processing loop while (!cancellationToken.IsCancellationRequested) { IReadOnlyCollection messages = await messenger.ReceiveAsync( "orders", count: 10, visibility: TimeSpan.FromMinutes(1)); if (messages.Count > 0) { foreach (QueueMessage msg in messages) { try { // Process message Console.WriteLine($"Received: {msg.StringContent}"); // Confirm processing by deleting await messenger.DeleteAsync("orders", new[] { msg }); } catch (Exception ex) { // Message will become visible again after visibility timeout Console.WriteLine($"Processing failed: {ex.Message}"); } } } else { // No messages, wait before polling again await Task.Delay(1000, cancellationToken); } } } ``` -------------------------------- ### Create Azure Data Lake Gen 2 Storage by Service Principal Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Data-Lake Set up Azure Data Lake Gen 2 storage authentication using a Service Principal. Call StorageFactory.Modules.UseAzureDataLake() before using this. ```csharp IBlobStorage storage = StorageFactory.Blobs.AzureDataLakeGen2StoreByClientSecret( accountName, tenantId, principalId, principalSecret); ``` -------------------------------- ### Simplified String Upload and Download Source: https://github.com/robinrodricks/fluentstorage/wiki/Blob-Storage Uploads and downloads a string directly using WriteTextAsync and ReadTextAsync, simplifying stream management for text content. ```csharp public async Task BlobStorage_sample2() { IBlobStorage storage = StorageFactory.Blobs.AzureBlobStorageWithSharedKey( "storage name", "storage key"); //upload it await storage.WriteTextAsync("mycontainer/someid", "test content"); //read back string content = await storage.ReadTextAsync("mycontainer/someid"); } ``` -------------------------------- ### Create Azure Data Lake Gen 2 Storage from Connection String (Service Principal) Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Data-Lake Use a connection string to authenticate with Azure Data Lake Gen 2 via Service Principal. Ensure the necessary module is registered. ```csharp IBlobStorage storage = StorageFactory.Blobs.FromConnectionString( "azure.datalake.gen2://account=...;tenantId=...;principalId=...;principalSecret=..."); ``` -------------------------------- ### Perform Folder and Blob Operations Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Use IBlobStorage extension methods to manage hierarchical structures, including folder creation, renaming, and cross-provider copying. ```csharp using FluentStorage; using FluentStorage.Blobs; IBlobStorage storage = StorageFactory.Blobs.DirectoryFiles(new DirectoryInfo("/data")); // Create a folder // For providers supporting hierarchy, creates actual folder // For flat providers (like S3), creates a placeholder file await storage.CreateFolderAsync("documents/2024/reports"); // Create folder with custom placeholder file await storage.CreateFolderAsync( folderPath: "archives/2024", dummyFileName: ".keep", dummyFileContent: "Placeholder to maintain folder structure"); // Rename blob or folder await storage.RenameAsync( oldPath: "documents/old-name.txt", newPath: "documents/new-name.txt"); // Copy blob to another location (same storage) await storage.CopyToAsync( blobId: "source/file.txt", targetStorage: storage, newId: "destination/file.txt"); // Copy blob to different storage provider IBlobStorage targetStorage = StorageFactory.Blobs.AzureBlobStorageWithSharedKey("account", "key"); await storage.CopyToAsync( blobId: "local/document.pdf", targetStorage: targetStorage, newId: "cloud/document.pdf"); ``` -------------------------------- ### Create Gzip Compressed Blob Storage Sink Source: https://github.com/robinrodricks/fluentstorage/wiki/Data-Compression Use the WithGzipCompression extension method to create a blob storage sink with Gzip compression. Optionally specify a CompressionLevel, which defaults to Optimal. ```csharp IBlobStorage storage = StorageFactory.Blobs .XXX() .WithGzipCompression(CompressionLevel compressionLevel = CompressionLevel.Optimal) ``` -------------------------------- ### Connection Strings Source: https://github.com/robinrodricks/fluentstorage/wiki/MinIO-Storage Connects to MinIO storage using a connection string after referencing the AWS storage module. ```APIDOC ## Connection Strings ### Description Connects to MinIO storage using a connection string. First, reference the AWS storage module using `StorageFactory.Modules.UseAwsStorage();`. ### Method ```csharp StorageFactory.Blobs.FromConnectionString(string connectionString); ``` ### Endpoint N/A (This is a client-side connection method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```csharp // Ensure the AWS module is referenced StorageFactory.Modules.UseAwsStorage(); // Construct using the connection string format IBlobStorage storage = StorageFactory.Blobs.FromConnectionString("minio.s3://keyId=YOUR_ACCESS_KEY;key=YOUR_SECRET_KEY;bucket=YOUR_BUCKET_NAME;region=YOUR_AWS_REGION;serviceUrl=YOUR_MINIO_SERVER_URL"); ``` ### Connection String Format `minio.s3://keyId=...;key=...;bucket=...;region=...;serviceUrl=...` - **keyId** (optional): Access key ID. - **key** (optional): Secret access key. - **bucket**: Bucket name. - **region**: The AWS account region (e.g., `us-east-1`). - **serviceUrl**: The URL of the MinIO storage provider. ### Response #### Success Response (200) Returns an `IBlobStorage` instance configured for MinIO. #### Response Example N/A (Client-side object creation) ``` -------------------------------- ### Connect to Wasabi Storage Source: https://github.com/robinrodricks/fluentstorage/wiki/AWS-S3-Storage Connect to Wasabi storage, an S3-compatible service, using the Wasabi method. Requires access key ID, secret access key, bucket name, and the Wasabi service URL. ```csharp IBlobStorage storage = StorageFactory.Blobs.Wasabi( accessKeyId, secretAccessKey, bucketName, wasabiServiceUrl); ``` -------------------------------- ### Connect to AWS S3 Source: https://github.com/robinrodricks/fluentstorage/wiki/AWS-S3-Storage Use the AwsS3 method to establish a connection to AWS S3 storage. Requires access key ID, secret access key, session token, and bucket name. ```csharp IBlobStorage storage = StorageFactory.Blobs.AwsS3( accessKeyId, secretAccessKey, sessionToken, bucketName); ``` -------------------------------- ### WithGzipCompression Extension Method Source: https://github.com/robinrodricks/fluentstorage/wiki/Data-Compression Applies Gzip compression to a blob storage sink during the configuration process. ```APIDOC ## WithGzipCompression ### Description Applies Gzip compression to the blob storage sink. This is part of the Data Transformation suite of functions. ### Parameters #### Method Parameters - **compressionLevel** (CompressionLevel) - Optional - The level of compression to apply. Defaults to CompressionLevel.Optimal. ### Request Example IBlobStorage storage = StorageFactory.Blobs .XXX() .WithGzipCompression(CompressionLevel.Optimal); ``` -------------------------------- ### Initialize AesSymmetricEncryptionSink Source: https://github.com/robinrodricks/fluentstorage/wiki/Migration-Guide Constructor for the encryption sink that initializes the AES algorithm with a provided key and generates a new initialization vector. ```csharp public AesSymmetricEncryptionSink(string key) { _cryptoAlgorithm = Aes.Create(); _cryptoAlgorithm.Key = Convert.FromBase64String(key); _cryptoAlgorithm.GenerateIV(); } ``` -------------------------------- ### Configure SAS Policies Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Blob-Storage Define policies and permissions for Shared Access Signatures. ```csharp var policy = new AccountSasPolicy(DateTimeOffset.?, TimeSpan.FromHours(1)); ``` ```csharp policy.Permissions = AccountSasPermission.List | AccountSasPermission.Read | AccountSasPermission.Write; ``` -------------------------------- ### VirtualStorage Mounting API Source: https://context7.com/robinrodricks/fluentstorage/llms.txt Methods for mounting multiple storage providers into a single virtual namespace. ```APIDOC ## POST /Mount ### Description Mounts an IBlobStorage provider to a specific virtual path. ### Method POST ### Endpoint Mount(string path, IBlobStorage storage) ### Parameters #### Request Body - **path** (string) - Required - The virtual path to mount the provider. - **storage** (IBlobStorage) - Required - The storage provider instance to mount. ## GET /ListAsync ### Description Lists blobs and mounted providers at a specific virtual path. ### Method GET ### Endpoint ListAsync(string path) ### Parameters #### Path Parameters - **path** (string) - Required - The virtual path to list contents from. ### Response #### Success Response (200) - **IReadOnlyCollection** (array) - A collection of blobs and mounted folders found at the specified path. ``` -------------------------------- ### Create Azure Data Lake Gen 2 Storage from Connection String (Shared Key) Source: https://github.com/robinrodricks/fluentstorage/wiki/Azure-Data-Lake Connect to Azure Data Lake Gen 2 using a connection string with Shared Key authentication. Remember to initialize the storage factory module. ```csharp IBlobStorage storage = StorageFactory.Blobs.FromConnectionString( "azure.datalake.gen2://account=...;key=..."); ``` -------------------------------- ### Apply GZipSink to Blob Storage Source: https://github.com/robinrodricks/fluentstorage/wiki/Custom-Sinks Use the .WithSinks extension method to apply a GZipSink to your IBlobStorage instance. This enables automatic GZip compression/decompression for blobs. ```csharp IBlobStorage storage = StorageFactory.Blobs .XXX() .WithSinks(new GZipSink()); ``` -------------------------------- ### Register AWS Storage Module Source: https://github.com/robinrodricks/fluentstorage/wiki/AWS-S3-Storage Before using connection strings for AWS storage, register the AWS storage module using UseAwsStorage(). ```csharp StorageFactory.Modules.UseAwsStorage(); ```