Skip to content

addAzureAppServiceEnvironment always produces ACR #19121

Description

@sveinung-t

Is there an existing issue for this?

  • I have searched the existing issues

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' })
  1. Add the above code to Typescript file apphost.mts
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-integrationsIssues pertaining to Aspire Integrations packagesneeds-area-labelAn area label is needed to ensure this gets routed to the appropriate area ownerstriage:bot-seenAspire triage bot has seen this issue

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions