|
| 1 | +--- |
| 2 | +title: "Breaking change - Azure Storage APIs renamed and refactored" |
| 3 | +description: "Learn about the breaking changes in .NET Aspire 9.4 where Azure Storage APIs were renamed and refactored for clarity and consistency." |
| 4 | +ms.date: 07/08/2025 |
| 5 | +ai-usage: ai-assisted |
| 6 | +ms.custom: https://github.com/dotnet/docs-aspire/issues/3930 |
| 7 | +--- |
| 8 | + |
| 9 | +# Azure Storage APIs renamed and refactored |
| 10 | + |
| 11 | +In .NET Aspire 9.4, several Azure Storage APIs were renamed and refactored for clarity and consistency. These changes affect how you add and configure Azure Blob, Queue, and Table storage resources and clients in your Aspire applications. The new API names better align with Azure resource naming and reduce confusion. |
| 12 | + |
| 13 | +## Version introduced |
| 14 | + |
| 15 | +.NET Aspire 9.4 |
| 16 | + |
| 17 | +## Previous behavior |
| 18 | + |
| 19 | +Previously, you used methods like `AddBlobs`, `AddBlobContainer`, `AddQueues`, and `AddTables` to add Azure Storage resources. |
| 20 | + |
| 21 | +**Hosting integration example:** |
| 22 | + |
| 23 | +```csharp |
| 24 | +var builder = DistributedApplication.CreateBuilder(args); |
| 25 | + |
| 26 | +var storage = builder.AddAzureStorage("storage"); |
| 27 | + |
| 28 | +var blobs = storage.AddBlobs("blobs"); |
| 29 | +var blobContainer = blobs.AddBlobContainer("container"); |
| 30 | + |
| 31 | +var queues = storage.AddQueues("queues"); |
| 32 | +var tables = storage.AddTables("tables"); |
| 33 | +``` |
| 34 | + |
| 35 | +Client registration methods also used names like `AddAzureBlobClient`, `AddAzureQueueClient`, and `AddAzureTableClient`. |
| 36 | + |
| 37 | +**Client integration example:** |
| 38 | + |
| 39 | +```csharp |
| 40 | +var builder = WebApplication.CreateBuilder(args); |
| 41 | + |
| 42 | +builder.AddAzureBlobClient("storage"); |
| 43 | +builder.AddAzureQueueClient("storage"); |
| 44 | +builder.AddAzureTableClient("storage"); |
| 45 | +``` |
| 46 | + |
| 47 | +## New behavior |
| 48 | + |
| 49 | +Now, the API uses more explicit names that match Azure resource types. For example, use `AddBlobService`, `AddBlobContainer`, `AddQueueService`, `AddQueue`, `AddTableService`, and `AddTable`. |
| 50 | + |
| 51 | +**Hosting integration example:** |
| 52 | + |
| 53 | +```csharp |
| 54 | +var builder = DistributedApplication.CreateBuilder(args); |
| 55 | + |
| 56 | +var storage = builder.AddAzureStorage("storage"); |
| 57 | + |
| 58 | +var blobs = storage.AddBlobService("blobService"); |
| 59 | +blobs.AddBlobContainer("container"); |
| 60 | + |
| 61 | +var queues = storage.AddQueueService("queueService"); |
| 62 | +queues.AddQueue("queue"); |
| 63 | + |
| 64 | +var tables = storage.AddTableService("tableService"); |
| 65 | +``` |
| 66 | + |
| 67 | +Client registration methods now use names like `AddAzureBlobServiceClient`, `AddAzureQueueServiceClient`, and `AddAzureTableServiceClient`. |
| 68 | + |
| 69 | +**Client integration example:** |
| 70 | + |
| 71 | +```csharp |
| 72 | +var builder = WebApplication.CreateBuilder(args); |
| 73 | + |
| 74 | +builder.AddAzureBlobServiceClient("storage"); |
| 75 | +builder.AddAzureQueueServiceClient("storage"); |
| 76 | +builder.AddAzureTableServiceClient("storage"); |
| 77 | +``` |
| 78 | + |
| 79 | +## Type of breaking change |
| 80 | + |
| 81 | +This change is a [binary incompatible](../categories.md#binary-compatibility) and [source incompatible](../categories.md#source-compatibility) change. |
| 82 | + |
| 83 | +## Reason for change |
| 84 | + |
| 85 | +The new API names provide consistency with Azure client libraries and resource granularity. This reduces confusion and makes it easier to understand and maintain Aspire applications that use Azure Storage resources. For more information, see the [GitHub issue](https://github.com/dotnet/docs-aspire/issues/3930). |
| 86 | + |
| 87 | +## Recommended action |
| 88 | + |
| 89 | +1. Update your code to use the new method names for adding and configuring Azure Storage resources and clients. |
| 90 | +1. Replace any obsolete method calls with their new equivalents as shown in the examples above. |
| 91 | +1. Recompile your application to ensure compatibility with .NET Aspire 9.4. |
| 92 | + |
| 93 | +## Affected APIs |
| 94 | + |
| 95 | +- <xref:Aspire.Azure.Hosting.Storage.AzureStorageResourceBuilder.AddBlobs> |
| 96 | +- <xref:Aspire.Azure.Hosting.Storage.AzureBlobStorageResourceBuilder.AddBlobContainer> |
| 97 | +- <xref:Aspire.Azure.Hosting.Storage.AzureStorageResourceBuilder.AddQueues> |
| 98 | +- <xref:Aspire.Azure.Hosting.Storage.AzureStorageResourceBuilder.AddTables> |
| 99 | +- <xref:Aspire.Azure.Hosting.Storage.AzureStorageResourceBuilder.AddBlobService> |
| 100 | +- <xref:Aspire.Azure.Hosting.Storage.AzureStorageResourceBuilder.AddBlobContainer> |
| 101 | +- <xref:Aspire.Azure.Hosting.Storage.AzureStorageResourceBuilder.AddQueueService> |
| 102 | +- <xref:Aspire.Azure.Hosting.Storage.AzureStorageResourceBuilder.AddQueue> |
| 103 | +- <xref:Aspire.Azure.Hosting.Storage.AzureStorageResourceBuilder.AddTableService> |
| 104 | +- <xref:Aspire.Azure.Hosting.Storage.AzureStorageResourceBuilder.AddTable> |
| 105 | +- <xref:Aspire.Azure.Storage.Blobs.BlobServiceClientBuilderExtensions.AddAzureBlobClient> |
| 106 | +- <xref:Aspire.Azure.Storage.Blobs.BlobServiceClientBuilderExtensions.AddAzureBlobServiceClient> |
| 107 | +- <xref:Aspire.Azure.Storage.Queues.QueueServiceClientBuilderExtensions.AddAzureQueueClient> |
| 108 | +- <xref:Aspire.Azure.Storage.Queues.QueueServiceClientBuilderExtensions.AddAzureQueueServiceClient> |
| 109 | +- <xref:Aspire.Azure.Data.Tables.TableServiceClientBuilderExtensions.AddAzureTableClient> |
| 110 | +- <xref:Aspire.Azure.Data.Tables.TableServiceClientBuilderExtensions.AddAzureTableServiceClient> |
| 111 | + |
| 112 | +For a complete list of changes, see the [pull request](https://github.com/dotnet/aspire/pull/10241). |
0 commit comments