user9623839
user9623839

Reputation: 41

I can't login to my azure container registry

I was following the steps in this Microsoft tutorial: https://learn.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-acr#container-registry-login

I've created a resource group, and then an azure container registry with "az acr create". The next step is to login to the registry, but I keep getting this error: Error response from daemon: Get https://azurereg.azurecr.io/v2/: Service Unavailable

Any ideas?

Upvotes: 4

Views: 12503

Answers (2)

Sapnandu
Sapnandu

Reputation: 642

I got the same error while logging to ACR

Then I use the following command to access the ACR

docker login myacrreg.azurecr.io -u myacrreg -p xF1ioa6K4FkKqbtt7j2yPf4rja6tiNvFhT34iq/tUx+ACRCNwSlG

you can find this username and password from the following

enter image description here

To check images (image list in the ACR)

docker images myacrreg.azurecr.io

Change local image tag with ACR image

docker tag myimage12:v1 myacrreg.azurecr.io/myimage12:v1 

Push into ACR

docker push myacrreg.azurecr.io/myimage12:v1

Upvotes: 0

Thorsten Hans
Thorsten Hans

Reputation: 2683

In order to access ACR from AKS, you can use the underlying service principal. That said, you've to create a role assignment for the Service Principal as mentioned in this paragraph https://learn.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks?toc=%2fazure%2faks%2ftoc.json#grant-aks-access-to-acr

Creating a role assignment for role Reader currently doesn't work. You've to create the assignment for the Owner role. (described in https://github.com/Azure/AKS/issues/76).

Keep in mind that K8s caches the token for a couple of minutes. It took 3-5 minutes on my cluster to work.

Upvotes: 0

Related Questions