Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In 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.
Version introduced
Aspire 9.4
Previous behavior
Previously, you used AddBlobs to call AddBlobContainer to add a blob container:
Hosting integration example:
var builder = DistributedApplication.CreateBuilder(args);
var storage = builder.AddAzureStorage("storage");
var blobs = storage.AddBlobs("blobs");
var blobContainer = blobs.AddBlobContainer("container");
Client registration methods also used names like AddAzureBlobClient, AddAzureQueueClient, and AddAzureTableClient.
Client integration example:
var builder = WebApplication.CreateBuilder(args);
builder.AddAzureBlobClient("storage");
builder.AddAzureQueueClient("storage");
builder.AddAzureTableClient("storage");
New behavior
Now, AddBlobContainer is a top level call on the storage resource.
Hosting integration example:
var builder = DistributedApplication.CreateBuilder(args);
var blobContainer = storage.AddBlobContainer("container");
Client registration methods now use names like AddAzureBlobServiceClient, AddAzureQueueServiceClient, and AddAzureTableServiceClient.
Client integration example:
var builder = WebApplication.CreateBuilder(args);
builder.AddAzureBlobServiceClient("storage");
builder.AddAzureQueueServiceClient("storage");
builder.AddAzureTableServiceClient("storage");
API changes summary
The following table summarizes the key hosting integration API changes:
| Obsolete API | New API | Notes |
|---|---|---|
AddBlobContainer |
AddBlobContainer |
New API uses IResourceBuilder<AzureStorageResource> overload. |
The following table summarizes the key client registration API changes:
| Obsolete API | New API |
|---|---|
AddAzureBlobClient |
AddAzureBlobServiceClient |
AddAzureQueueClient |
AddAzureQueueServiceClient |
AddAzureTableClient |
AddAzureTableServiceClient |
Type of breaking change
This change is a binary incompatible and source incompatible change.
Reason for change
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.
Recommended action
- Update your code to use the new method names for adding and configuring Azure Storage resources and clients.
- Replace any obsolete method calls with their new equivalents as shown in the examples above.
- Recompile your application to ensure compatibility with Aspire 9.4.
Affected APIs
AddBlobContainerAddAzureBlobClientAddAzureQueueClientAddAzureTableClient
For a complete list of changes, see the pull request.