Support for Configuring Public Access Levels for Azure Blob Containers in Aspire
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
Currently, when defining an Azure Blob Storage container in an Aspire application (likely using an emulator like Azurite), there is no straightforward way to configure the public access level for that container.
The Azure Blob Storage service allows for three distinct levels of public access:
Private (No public access): Data can only be accessed by authenticated users with appropriate permissions (e.g., SAS token, Account Key).
Container public access: Allows anonymous read access to both the container and its blobs. Users can enumerate the blobs within the container.
Blob public access: Allows anonymous read access to the blobs within the container, but does not allow anonymous enumeration of the container itself.
Our application may require a specific public access level for certain containers (e.g., a container for public assets needs "Blob public access," while a container for user data needs "Private"). Manually setting this level in the storage emulator is a cumbersome, non-reproducible step.
### Describe the solution you'd like
We request the ability to define the desired public access level directly on the Azure Storage container resource within the AppHost project. This configuration should be applied automatically to the storage emulator when the application starts up.
This would involve introducing a new configuration option or method that accepts a specific access level enum (or string) when defining the container.
```csharp
var memesBlobs = storage.AddBlobs("memes-blobs")
.WithContainerAccess(PublicAccessType.Blob);
```
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.