Repository navigation
Conversation
Adds WithStorage(), which models floci-az's Blob, Queue and Table APIs as a FlociAzureStorageResource child alongside WithCosmos and WithServiceBus. The child reports the Floci container's health, so dependents can WaitFor it without redirecting Aspire's AzureStorageResource, whose health checks never initialize when redirected. Storage endpoints use the IPv4 host so the Azure Storage SDKs read the account name from the path. Also corrects DefaultAccountKey to the well-known devstoreaccount1 key; floci-az rejected SharedKey requests signed with the old value. Closes CommunityToolkit#2222
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 2223Or
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 2223" |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The documented TypeScript export lacks coverage in the existing generated AppHost test, and one credential comment is now inaccurate.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds first-class Floci Azure Storage child-resource support and corrects SharedKey authentication.
Changes:
- Adds exported
WithStorage()and storage connection metadata. - Corrects the development account key.
- Adds unit, functional, and usage documentation coverage.
| File | Description |
|---|---|
WithReferenceTests.cs |
Tests storage references, health, naming, and validation. |
CommunityToolkit.Aspire.Hosting.Floci.Tests.csproj |
Adds the Blob SDK dependency. |
AzureStorageFunctionalTests.cs |
Tests Blob operations and SAS authentication. |
README.md |
Documents C# and TypeScript usage. |
FlociHostingExtension.Azure.cs |
Adds the exported WithStorage() API. |
FlociAzureStorageResource.cs |
Defines the Storage child resource and connection string. |
FlociAzureContainerResource.cs |
Corrects the development account key. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| /// <param name="builder">The Floci Azure resource builder.</param> | ||
| /// <param name="name">The name of the Storage resource (default: <c>storage</c>).</param> | ||
| /// <returns>A reference to the <see cref="IResourceBuilder{FlociAzureStorageResource}"/> for further configuration.</returns> | ||
| [AspireExport] |
| // Well-known Azurite-compatible dev credentials that floci-az accepts by default (no auth enforced). | ||
| internal const string DefaultAccountName = "devstoreaccount1"; | ||
| internal const string DefaultAccountKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMh0=="; | ||
| internal const string DefaultAccountKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="; |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #2222
Adds
WithStorage(), which models floci-az's Blob, Queue and Table APIs as aFlociAzureStorageResourcechild. It follows the existingWithCosmos()/FlociAzureCosmosResourcepattern: aResourcethat implementsIResourceWithParent<FlociAzureContainerResource>andIResourceWithConnectionString, usesWithParentRelationship, and works with Aspire's standardWithReferenceflow.ResourceHealthCheckServiceapplies ancestor health checks, so the child reports the Floci container's/_floci/healthandWaitFor(storage)works. This removes the reason AppHosts redirectAzureStorageResourceto Floci, which leaves Aspire's blob health check permanentlyUnhealthy("Connection string is not initialized.").BlobEndpoint,QueueEndpointandTableEndpointuseEndpointProperty.IPV4Hostrather thanlocalhost. The Azure Storage SDKs only take the account name from the path for IP hosts, so withlocalhost,BlobServiceClient.AccountNameresolves tolocalhostand SAS generation signs for the wrong account.FlociAzureContainerResource.DefaultAccountKeyended in...GMh0==; the well-known devstoreaccount1 key ends in...GMGw==. floci-az validates SharedKey signatures, so requests signed with the old key failed withAuthenticationFailed. The new functional test failed for this reason before the fix. The fix also correctsAZURE_STORAGE_CONNECTION_STRINGfromWithReference(azure).PR Checklist
Other information
Tests:
WithReferenceTestscovers the child resource and parent relationship, the connection string shape (including the IPv4 host), custom names, argument validation, and that the child inherits the parent's health check rather than adding its own.[RequiresDocker]AzureStorageFunctionalTestsstarts floci-az, waits for the storage child to become healthy, then round-trips a blob withBlobServiceClient. It also checks thatAccountNameisdevstoreaccount1and that a generated SAS URI downloads the blob.CommunityToolkit.Aspire.Hosting.Floci.Testspass. The one failure,TypeScriptAppHostTests.TypeScriptAppHostCompilesAndStarts, also fails on unmodifiedmainon my Windows machine: thefloci-mountbind-mount container never starts. It is unrelated to this change.I did not hand-edit the generated
api/*.csfile, per the repo instructions.The issue has not been triaged yet. I'm opening this PR alongside it so maintainers can see the concrete shape; I'm happy to rework it if a different API is preferred.