Cannot connect azure container registry to devops platform as admin ??

Melonendk 20 Reputation points
2023-01-14T21:21:16.2066667+00:00

So we are trying to create a docker container image and upload it to an ACR with the devops pipelines, but wherever we try it fails and say i dont have permission even tho we have checked for months now and should have the right permissions to connect and use the ACR.

We tried following guides but seem to be outdated a lot so no luck there.
But each time we end up getting an nice error of this

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 'live.com#' 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.

Which is weird... why would i need to be owner og an UAAdmin to create a pipeline and connection ?

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
508 questions
{count} votes

Accepted answer
  1. Eddie Neto 1,251 Reputation points Microsoft Employee
    2023-01-16T11:24:14.81+00:00

    Hi @Melonendk

    To Build and push Docker images to Azure Container Registry, you must enable the admin user account in order for you to deploy a Docker image from an Azure Container Registry.

    Create a container registry

    Hope this helps. Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.


1 additional answer

Sort by: Most helpful
  1. Lex Li (Microsoft) 6,037 Reputation points Microsoft Employee
    2023-01-15T05:47:41.6866667+00:00

    You can only upload a container image to ACR, not a container instance itself.

    How did you configure your pipeline to upload?

    Ideally you should use a service principal with the role of acrpush (not the acrpull in the example).


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.