Azure ContainerApps YAML 注册表身份

问题描述 投票:0回答:1

我正在尝试通过 YAML 配置文件启动 Azure ContainerApp 服务。问题出在以下块上:

registries:
  - passwordSecretRef: null
    server: xxx.azurecr.io
    identity: "/subscriptions/xxx/resourcegroups/xxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mymanagedidentity"
    username: null

错误信息如下:

(InvalidParameterValueInContainerTemplate) 以下字段无效或缺失。字段“configuration.Registries.xxx.azurecr.io.Identity”的详细信息无效:“无效值:“/subscriptions/xxx/resourcegroups/xxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mymanagementidentity”:托管标识不存在” ;.

此用户分配的托管确实存在,并且对 acr 范围具有 AcrPull 权限。我可以通过运行 az Identity show --name mymanagementidentity --resource-group xxx --query id --output tsv

来确认

此外,如果我通过引用此托管身份的 cli 命令创建容器应用程序,它会完美地工作。

az containerapp create --registry-identity /subscriptions/xxx/resourcegroups/xxx/providers/Microsoft.ManagedIdentity/userAssignedIdentities/mymanagedidentity --registry-server xxx.azurecr.io

如果您能提供有关可能出现的问题以及如何解决该问题的任何意见,我将不胜感激!

azure azure-managed-identity azure-container-registry azure-container-apps
1个回答
1
投票

除了在存储库配置中使用它之外,您还需要将身份添加到应用程序的身份列表中。

我需要将以下块添加到 YAML 配置文件中才能正常工作:

© www.soinside.com 2019 - 2024. All rights reserved.