Expose API on AzureStorageResource to get the emulator connection string
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in src/Aspire.Hosting.Azure.Storage/AzureStorageResource.cs at the internal emulator connection-string method linked in the issue. Expose the proposed EmulatorConnectionString property and verify that the provided Azure Storage Explorer usage can consume it when IsEmulator is true.
Written by the indexing model from the issue text.
Description
Background and Motivation
There are scenarios where resource want to get the full emulator connection string from the Azure storage emulator (Azurite) resource. We have an internal method today
Proposed API
namespace Aspire.Hosting;
public class AzureStorageResource
{
+ public ReferenceExpression EmulatorConnectionString { get; }
}
Usage Examples
var storage = builder.AddAzureStorage("storage")
.RunAsEmulator();
var blobs = storage.AddBlobs("blobs");
if (storage.Resource.IsEmulator)
{
// Add the Azure Storage Explorer container when running in the emulator
builder.AddContainer("storage-explorer", "sebagomez/azurestorageexplorer")
.WithHttpEndpoint(targetPort: 8080)
.WithEnvironment("AZURE_STORAGE_CONNECTIONSTRING", storage.Resource.EmulatorConnectionString);
}
Alternative Designs
We could make AzureStorageResource implement IResourceWithConnectionString and do the same. It would only work if IsEmulator was true.
+ public class AzureStorageResource : IResourceWithConnectionString
{
+ public ReferenceExpression ConnectionStringExpression => IsEmulator ? ... : throw new NotSupportedException(...);
}
var storage = builder.AddAzureStorage("storage")
.RunAsEmulator();
var blobs = storage.AddBlobs("blobs");
if (storage.Resource.IsEmulator)
{
// Add the Azure Storage Explorer container when running in the emulator
builder.AddContainer("storage-explorer", "sebagomez/azurestorageexplorer")
.WithHttpEndpoint(targetPort: 8080)
.WithEnvironment("AZURE_STORAGE_CONNECTIONSTRING", storage);
}
Risks
None
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 992
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 176
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/aspire
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows needs-area-label
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
area-app-model
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
area-integrations triage:bot-seen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
All issues in microsoft/aspire
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OrchardCMS/OrchardCore#19919 · 2 comments ·