繁体   English   中英

无法将 Azure-DevOps 与 Azure 容器注册表连接

[英]Unable to connect Azure-DevOps with Azure Container Registry

我在 DevOps Build Pipeline 中创建了一个 Build Docker Image 任务。 在此任务中,选择 Azure 订阅后, Azure 容器注册表列表显示未找到结果消息。

虽然我已经在该订阅中创建了 ACR,但我无法通过 DevOps Build Pipeline 连接到它。

此问题与权限或任何其他问题有关吗?

您是否为 Azure DevOps 管道创建了服务主体 创建后,您可以为其指定适当的角色来执行您要执行的操作。

# Assign the desired role to the service principal. Modify the '--role' argument
# value as desired:
# acrpull:     pull only
# acrpush:     push and pull
# owner:       push, pull, and assign roles
az role assignment create --assignee $SERVICE_PRINCIPAL_ID --scope $ACR_REGISTRY_ID --role acrpull

在您的构建管道中,您需要在 Docker 构建和/或推送任务之前添加一个使用现有服务连接的登录任务。 服务连接具有您将上传 Docker 映像的 Azure 容器注册表的订阅和名称。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM