-
Notifications
You must be signed in to change notification settings - Fork 854
Azurite emulator needs --looseBlobEndpoint for container-to-container access #14044
Copy link
Copy link
Closed
Closed
Copy link
Labels
area-integrationsIssues pertaining to Aspire Integrations packagesIssues pertaining to Aspire Integrations packages‼️regression-from-last-releaseThis used to work in an earlier version of Aspire and we broke it!This used to work in an earlier version of Aspire and we broke it!
Milestone
Description
Describe the bug
When a container resource (e.g., AddDockerfile) references Azure Storage running as emulator, the injected connection string uses storage.dev.internal as the hostname. However, Azurite does not recognize this hostname and returns 404 ResourceNotFound errors.
The same request works when using the actual container name directly (e.g., storage-abc123):
storage.dev.internal:10000→ 404 ResourceNotFoundstorage-abc123:10000→ 403 AuthorizationFailure (container exists, just needs auth)
Root Cause
Azurite uses hostname-based account routing. The DNS alias storage.dev.internal is not recognized as belonging to devstoreaccount1.
Note: The --loose flag does NOT fix this issue. It only ignores unsupported headers/parameters, not hostname routing.
Workaround
Override the connection string in the client integration to use the actual container name:
builder.AddAzureBlobContainerClient("workspaces", settings =>
{
var connStr = builder.Configuration.GetConnectionString("workspaces");
if (connStr?.Contains("storage.dev.internal") == true)
{
// Replace with actual container hostname
connStr = connStr.Replace("storage.dev.internal", "storage-actualname");
}
});Expected Behavior
Aspire should either:
- Use the actual container name in connection strings for container-to-container networking
- Configure Azurite to recognize the
storage.dev.internalalias
Steps To Reproduce
- Create an AppHost with Azure Storage emulator
- Add a Dockerfile-based resource that references the storage
- The container gets connection string with
BlobEndpoint=http://storage.dev.internal:10000/devstoreaccount1 - Blob operations fail with 404 ResourceNotFound
Environment
- .NET 10 Preview
- Aspire 13.x
- Docker Desktop on macOS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-integrationsIssues pertaining to Aspire Integrations packagesIssues pertaining to Aspire Integrations packages‼️regression-from-last-releaseThis used to work in an earlier version of Aspire and we broke it!This used to work in an earlier version of Aspire and we broke it!