Skip to content

[WebToolsE2E][Aspire] After added 'Aspire.Azure.Storage.Blobs' and use '.RunAsEmulator()', there are three URLs under the Endpoints of storage. #2538

@v-reinawang

Description

@v-reinawang

REGRESSION INFO: New feature for Aspire 8.0 Preview 4

INSTALL STEPS

  1. Clean machine: Win11 x64 23h2 ENU
  2. Install 17.10.0 Preview 2.0 [34628.166.main] (Includes Aspire 8.0.0-preview.4.24128.4)
  3. Apply NuGet Feeds

REPRO STEPS

  1. New Project > .NET Aspire Starter Application > named it 'AspireApp1' > .NET 8.0 > Create
  2. Right-click AspireApp1.web project > Add >  Aspire component > Aspire.Azure.Storage.Blobs > add a component and try to use it in the code
  3. Open appsettings.json > make changes related to Aspire component
{ 
  "Aspire": { 
    "Azure": { 
      "Storage": { 
        "Blobs": { 
          "HealthChecks": false, 
          "Tracing": true, 
          "ClientOptions": { 
            "Diagnostics": { 
              "ApplicationId": "myapp"} 
          } 
        } 
      } 
    } 
  } 
} 
  1. In the Program.cs of web project, type following codes:
    builder.AddAzureBlobService("blobsConnectionName");

  2. Open appsettings.json of AspireApp1.AppHost project, add ConnectionStrings configuration section:

{ 
  "ConnectionStrings": { 
    "blobsConnectionName": "https://{account_name}.blob.core.windows.net/" 
  } 
} 
  1. Open Program.cs of AspireApp1.AppHost project, add following codes:
var blobs = builder.AddAzureStorage("storage")
    .RunAsEmulator()
    .AddBlobs("blobs");

var myService = builder.AddProject<Projects.AspireApp1_Web>("webfrontend")
                       .WithReference(blobs);

Note: If you replace the code in step 6 with the following code, the result is as shown below

var blobs = builder.AddConnectionString("blobs");

var myService = builder.AddProject<Projects.AspireApp1_Web>("webfrontend")
                       .WithReference(blobs);

image

ACTUAL
There are three URLs under the Endpoints of storage.
image

EXPECTED
Only one url.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions