Is there an existing issue for this?
Describe the bug
When running aspire publish my Azure App Service Environment setup is attempting to create another Azure Container Registry, even if one is provided to it already.
Expected Behavior
addAzureAppServiceEnvironment should not attempt to create an additional Azure Container Registry when one is already provided.
Steps To Reproduce
const acr = await builder.addAzureContainerRegistry('application-acr')
.publishAsExisting('playgroundoverviewacr', { resourceGroup: 'application' })
const appservice = await builder.addAzureAppServiceEnvironment('application')
.withAzureContainerRegistry(acr)
.withAcrPullIdentity(key)
.publishAsExisting('application', { resourceGroup: 'application' })
- Add the above code to Typescript file
apphost.mts
- Attempt to run
aspire publish
Exceptions (if any)
❌ Capability Error: Cannot add resource of type 'Aspire.Hosting.Azure.AzureContainerRegistryResource' with name 'application-acr' because resource of
type 'Aspire.Hosting.Azure.AzureContainerRegistryResource' with that name already exists. resource names are case-insensitive.
Code: INTERNAL_ERROR
Capability: Aspire.Hosting.Azure.AppService/addAzureAppServiceEnvironment
❌ An unexpected error occurred: The TypeScript (Node.js) apphost failed.
Aspire doctor output
PS C:\path\to\application> aspire doctor
Aspire Environment Check
========================
Aspire
✅ Aspire CLI version 13.4.6 (channel: stable)
AppHost
✅ AppHost version 13.4.6 (aspire-apphost\apphost.mts)
Container Runtime
⚠️ Docker: installed but not running ← active
Start Docker Desktop
Environment
✅ TypeScript AppHost tooling found (npm, npx).
✅ HTTPS development certificate is trusted
Summary: 4 passed, 1 warnings, 0 failed
For detailed prerequisites: https://aka.ms/aspire-prerequisites
Aspire CLI Installations
========================
╭────────────────────────────────────────────────────────────────┬─────────────────────────────────────────────────┬──────────────┬──────────────┬─────────────╮
│ Path │ Version │ Channel │ Route │ PATH status │
├────────────────────────────────────────────────────────────────┼─────────────────────────────────────────────────┼──────────────┼──────────────┼─────────────┤
│ C:\Users\{redacted}\.aspire\npm\13.4.6\win-x64\bin\aspire.exe │ 13.4.6+87fe259e4fc244c599019a7b1304c85a1488f248 │ stable │ (unknown) │ not on PATH │
│ (current) │ │ │ │ │
│ C:\Users\{redacted}\AppData\Roaming\npm\aspire.CMD │ (not probed) │ (not probed) │ (not probed) │ active │
│ C:\Users\{redacted}\AppData\Local\Microsoft\WinGet\Packages\Mic│ (not probed) │ (not probed) │ (not probed) │ shadowed │
│ rosoft.Aspire_Microsoft.Winget.Source_8wekyb3d8bbwe\aspire.EXE │ │ │ │ │
╰────────────────────────────────────────────────────────────────┴─────────────────────────────────────────────────┴──────────────┴──────────────┴─────────────╯
Anything else?
If the names do not collide no error is generated, but this just means it successfully creates a bicep for another Azure Container Registry.
Is there an existing issue for this?
Describe the bug
When running
aspire publishmy Azure App Service Environment setup is attempting to create another Azure Container Registry, even if one is provided to it already.Expected Behavior
addAzureAppServiceEnvironmentshould not attempt to create an additional Azure Container Registry when one is already provided.Steps To Reproduce
apphost.mtsaspire publishExceptions (if any)
Aspire doctor output
Anything else?
If the names do not collide no error is generated, but this just means it successfully creates a bicep for another Azure Container Registry.