Azure DevOps Pipeline - 推送到 Azure 容器注册表 - 权限错误

标签 azure azure-devops azure-pipelines azure-container-registry

  • 我创建了一个 Azure 容器注册表。
  • 我有一个 Azure DevOps 项目。
  • 我已经使用向导创建了一个 Azure DevOps Pipeline,因此 它使用标准模板来构建和推送 Docker 镜像。

验证管道时抛出以下错误:

Failed to set Azure permission 'RoleAssignmentId: ****' for the service principal '****' on subscription ID '****': error code: Forbidden, inner error code: AuthorizationFailed, inner error message The client '****' with object id '****' does not have authorization to perform action 'Microsoft.Authorization/roleAssignments/write' over scope '/subscriptions/****/resourceGroups/****/providers/Microsoft.ContainerRegistry/registries/****/providers/Microsoft.Authorization/roleAssignments/****' or the scope is invalid. If access was recently granted, please refresh your credentials. Ensure that the user has 'Owner' or 'User Access Administrator' permissions on the Subscription.

我可能缺少什么配置?这方面的文档非常稀疏,而且写得好像它应该都能正常工作一样。

谢谢

最佳答案

您需要向此处使用的服务主体添加 AcrPull 权限。请找到您的 ACR 并添加它。

这里有您的服务主体的 ID:

Failed to set Azure permission 'RoleAssignmentId: ' for the service principal ''

另外,请检查 ACR 上的网络是否阻止您。

关于Azure DevOps Pipeline - 推送到 Azure 容器注册表 - 权限错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70783089/

相关文章:

Azure CLI - 将 Azure DevOps 通用包下载到 AzureML 计算实例时出现 "Hard linking failed!"

azure-devops - 停止管道中几个小时以来一直运行的作业

azure-devops - Azure DevOps : Error: No package found with specified pattern: D:\a\1\s\**\*. zip

azure - 如果构建有任何警告,则 Azure DevOps 构建管道失败

azure-devops - 如何在可从单元测试访问的 Azure DevOps 服务中传递/存储 secret

windows - 我无法从我的本地计算机 ping windows azure VM 的 VIP

azure - azure cloudapp.net 的 SSL 证书

c# - 无法加载文件或程序集 'XXX' 或其依赖项之一。该系统找不到指定的文件

azure-devops - 如何使用 Azure API 管理的 Azure DevOps 完成 CI/CD 管道

azure-devops - 使用 Azure DevOps Services REST API 添加超链接到描述