Repository navigation
containerapp ACR domain suffix hardcoded to .azurecr.io, breaking sovereign cloud support #9728
Copy link
Copy link
Open
Labels
Auto-AssignAuto assign by botAuto assign by botContainerAppService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.
Description
Activity
- addedbugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.
on Mar 26, 2026 - addedquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.Auto-AssignAuto assign by botAuto assign by bot
on Mar 26, 2026 - addedAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.
on Mar 26, 2026 Thank you for opening this issue, we will look into it.
microsoft-github-policy-service commented
on Mar 26, 2026 ContributorMore actionsThanks for the feedback! We are routing this to the appropriate team for follow-up. cc Hong Wang (@howang-ms), Greedygre (@Greedygre).
- removedquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI team
on Mar 26, 2026
Metadata
Metadata
Assignees
Labels
Auto-AssignAuto assign by botAuto assign by botContainerAppService AttentionThis issue is responsible by Azure service team.This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.
Describe the bug
The
containerappcommand module (both inazure-clicore and thecontainerappextension) hardcodes the ACR login server domain suffix as".azurecr.io". This breaks all ACR-related operations when using Azure sovereign clouds (e.g., Azure China / Mooncake), where ACR registries use the domain suffix".azurecr.cn".There are three root-cause locations:
Location 1 — Constant definition (hardcoded string)
File:
src/azure-cli/azure/cli/command_modules/containerapp/_constants.pySame constant also duplicated in the extension:
File:
src/containerapp/azext_containerapp/_constants.pyLocation 2 —
_infer_acr_credentials()gates all ACR detectionFile:
src/azure-cli/azure/cli/command_modules/containerapp/_utils.pyWhen
registry_server = "myacr.azurecr.cn", the check".azurecr.io" not in registry_serverisTrue, so the function immediately raises an error and treats the China ACR as a non-ACR registry. Credential inference, managed identity setup, andacrpullrole assignment all fail as a result.Location 3 —
create_acrpull_role_assignment()crashes withValueErrorFile:
src/azure-cli/azure/cli/command_modules/containerapp/_utils.pystr.rindex(".azurecr.io")raises an unhandledValueErrorwhenregistry_serveris"myacr.azurecr.cn", causing a crash instead of a clean error message.Related command
Errors
Command:
Error:
If we remove --registry-server from the command in hoping it can work around the azurecr.io requirement
Issue script & Debug output
az cloud set --name AzureChinaCloud az login az containerapp create \ --name myapp \ --resource-group myRG \ --environment myEnv \ --image myacr.azurecr.cn/myimage:latest \ --registry-server myacr.azurecr.cn \ --registry-identity system \ --debugExpected behavior
The extension should dynamically resolve the ACR domain suffix from the active cloud endpoint configuration rather than hardcoding it.
Environment Summary
azure-cli 2.84.0
core 2.84.0
telemetry 1.1.0
Extensions:
containerapp 1.3.0b4
resource-graph 2.1.1
Dependencies:
msal 1.35.0b1
azure-mgmt-resource 24.0.0
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\xx.azure'
Extensions directory 'C:\Users\xxx.azure\cliextensions'
Python (Windows) 3.13.11 (tags/v3.13.11:6278944, Dec 5 2025, 16:17:02) [MSC v.1944 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response