Getting "unauthorized: authentication required" when pulling ACR images from Azure Kubernetes Service Getting "unauthorized: authentication required" when pulling ACR images from Azure Kubernetes Service kubernetes kubernetes

Getting "unauthorized: authentication required" when pulling ACR images from Azure Kubernetes Service


The link you posted in the question is the correct steps for Authenticate with Azure Container Registry from Azure Kubernetes Service. I tried before and it works well.

So I suggest you can check if the service-principal-ID and service-principal-password are correct in the command kubectl create secret docker-registry acr-auth --docker-server <acr-login-server> --docker-username <service-principal-ID> --docker-password <service-principal-password> --docker-email <email-address>. And the secret you set in the yaml file should also be check if the same as the secret you created.


Jeff & Charles - I also experienced this issue, but found that the actual cause of the issue was that AKS was trying to pull an image tag from the container registry that didn't exist (e.g. latest). When I updated this to a tag that was available (e.g. 9) the deployment script on azure kubernetes service (AKS) worked successfully.

I've commented on the product feedback for the guide to request the error message context be improved to reflect this root cause.

Hope this helps! :)


In my case, I was having this problem because my clock was out of sync. I run on Windows Subsytem for Linux, so running sudo hwclock -s fixed my issue.

See this GitHub thread for longer discussion.