azure - 无法使用 az up 命令更新 containerApp 的镜像

标签 azure azure-container-registry azure-container-apps

我有一个通过二头肌脚本使用默认公共(public)图像构建的容器应用程序。 我将系统管理的身份分配给容器应用程序。我已将 AcrPull 角色分配给 ACR 私有(private)注册表 enter image description here 上的身份

ACR 私有(private)注册表已禁用管理员凭据,因此我在 containerApp 中使用托管身份。

我尝试使用此命令通过 azure shell 使用来自 ACR 的图像更新 containerApp

az containerapp up -n mycontainerapp -g my-rg -i myregistry.azurecr.io/mybranch-dev:latest --ingress external --target-port 5173

enter image description here 收到此错误:

Failed to retrieve credentials for container registry.  Please provide the registry username and password.

有人可以帮忙吗?谢谢

最佳答案

我已按照以下步骤使用托管身份在 ACR 和 ACA 之间建立连接来拉取图像,如下所示。请检查您是否可以按照以下步骤解决该问题。

为了重现该问题,我配置了容器应用程序和容器注册表。 转到 Azure 容器应用并启用系统分配的托管标识(如下所示)并添加 AcrPull 角色。

enter image description here

enter image description here

enter link description here

将 AcrPull 角色添加到 ACA 后,我将示例镜像推送到容器注册表,如下所示。

enter image description here

编辑:

现在,在从 ACR 更新容器应用程序中的镜像之前,您必须编辑修订版本,因为现有修订版本是使用公共(public)存储库创建的。 要编辑修订版本,请转到 ACA 中的容器,然后单击“编辑并部署”。 enter image description here

enter image description here 单击保存并创建新修订。您还可以在revisions中使用验证.

现在我使用 az containerapp update更新图像

az containerapp update -n <container-app-name> -g <rg-name> -i acrvjyps.azurecr.io/nginx:v5

enter image description here

引用:https://learn.microsoft.com/en-us/azure/container-apps/managed-identity-image-pull?tabs=azure-cli&pivots=azure-portal

关于azure - 无法使用 az up 命令更新 containerApp 的镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76610215/

相关文章:

azure - 在Azure容器应用程序中配置dapr日志级别

azure - 错误 :ManagedEnvResourceDisallowedByPolicy, 消息:无法创建托管环境,因为策略不允许创建所需资源

Azure 事件中心 - "ErrorCode":"Forbidden","ErrorMessage":"SubCode=40300. 已达到或超过 EventHub 类型的资源最大数量

reactjs - 当后端托管在 Azure 上时,create-react-app 代理请求失败并显示 404

rest - 通过 REST 处理 Azure 容器注册表中的图像

具有 blobfuse 或 Azure 存储 Blob 的 Azure 容器实例

azure - 创建 Azure 容器注册表任务时如何引用文件夹中的 Dockerfile?

适用于 Azure 容器应用程序的 Azure Rest API

azure - 如何从Azure指标获取 "Network In"和 "Network Out"?

linux - Sqlite DB 锁定在 Azure Dotnet Core Entity Framework 上