-
Notifications
You must be signed in to change notification settings - Fork 696
Refactor Azure Storage API #10241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Azure Storage API #10241
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the Azure Storage API surface to unify naming, add first‐class support for queues and tables, and update all downstream usages (tests, samples, snapshots, docs) to the new methods.
- Rename service‐level methods (
AddBlobs
,AddQueues
,AddTables
) toAddBlobService
,AddQueueService
,AddTableService
(and their client‐builder equivalents). - Introduce
AddAzureQueueServiceClient
,AddAzureQueue
, and support forQueueClient
registration alongside existingBlobServiceClient
flows. - Update all test projects, snapshots, playground apps, and README docs to use the new APIs and adjust provisioning/infrastructure logic for queues and tables.
Comments suppressed due to low confidence (2)
tests/Aspire.Hosting.Azure.Tests/Snapshots/AzureStorageExtensionsTests.AddAzureStorageViaRunModeAllowSharedKeyAccessOverridesDefaultFalse.verified.bicep:26
- The snapshot removes the blobServices resource—ensure that the blob service resource is still generated when overriding shared key access defaults.
output blobEndpoint string = storage.properties.primaryEndpoints.blob
tests/Aspire.Hosting.Azure.Tests/AzureResourcePreparerTests.cs:55
- [nitpick] The variable
blobs
refers to a single BlobService resource—consider renaming toblobService
to match the singular API method.
var blobs = storage.AddBlobService("blobs");
tests/Aspire.Hosting.Azure.Tests/AzureStorageExtensionsTests.cs
Outdated
Show resolved
Hide resolved
src/Components/Aspire.Azure.Storage.Queues/AspireQueueStorageExtensions.cs
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.Storage/api/Aspire.Hosting.Azure.Storage.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.Storage/api/Aspire.Hosting.Azure.Storage.cs
Outdated
Show resolved
Hide resolved
src/Components/Aspire.Azure.Storage.Blobs/api/Aspire.Azure.Storage.Blobs.cs
Show resolved
Hide resolved
src/Components/Aspire.Azure.Storage.Blobs/AspireBlobStorageExtensions.cs
Outdated
Show resolved
Hide resolved
playground/AzureFunctionsEndToEnd/AzureFunctionsEndToEnd.Functions/MyAzureBlobTrigger.cs
Outdated
Show resolved
Hide resolved
playground/AzureFunctionsEndToEnd/AzureFunctionsEndToEnd.Functions/MyAzureBlobTrigger.cs
Show resolved
Hide resolved
playground/AzureStorageEndToEnd/AzureStorageEndToEnd.ApiService/Program.cs
Show resolved
Hide resolved
src/Components/Aspire.Azure.Storage.Queues/AzureStorageQueueSettings.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.Storage/Aspire.Hosting.Azure.Storage.csproj
Outdated
Show resolved
Hide resolved
/// <param name="name">The name of the resource.</param> | ||
/// <param name="queueName">The name of the queue.</param> | ||
/// <param name="parent">The <see cref="AzureQueueStorageResource"/> that the resource is stored in.</param> | ||
public class AzureQueueStorageQueueResource(string name, string queueName, AzureQueueStorageResource parent) : Resource(name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this (and blob container) implement IResourceWithAzureFunctionsConfig
?
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
I’d like this to go into 9.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are 2 things left that need to be addressed:
- Functions support
- What happens when AddBlobService is called more than once.
playground/AzureFunctionsEndToEnd/AzureFunctionsEndToEnd.AppHost/Program.cs
Outdated
Show resolved
Hide resolved
playground/AzureStorageEndToEnd/AzureStorageEndToEnd.AppHost/aspire-manifest.json
Show resolved
Hide resolved
src/Components/Aspire.Azure.Storage.Blobs/Aspire.Azure.Storage.Blobs.csproj
Outdated
Show resolved
Hide resolved
/backport to release/9.4 |
Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/16179639157 |
Description
I added the API diff to make it easier to see the new/obsolete methods. I don't think it will be necessary to remove these before merging (right?).
TBD:
Fixes #6875
Checklist
<remarks />
and<code />
elements on your triple slash comments?