1
votes

I have created a Build Docker Image task inside DevOps Build Pipeline. In this task, after selecting the Azure Subscription, the Azure container registry list shows No results Found message.

Although I have created the ACR in that subscription, I'm unable to connect to it via DevOps Build Pipeline.

Is this issue related to permissions or any other?

2
Does the ACR in the same region as your DevOps?Charles Xu

2 Answers

1
votes

Did you create a Service Principal for Azure DevOps pipeline? Once created you can give it the proper role for what you are trying to do.

# 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
0
votes

In your build pipeline, you need to add a login task that uses an existing Service Connection before your Docker build and/or push task. The Service Connection has the subscription and the name of the Azure Container Registry where you will be uploading your Docker images.