Reputation: 91
Receiving an authorization error:
unauthorized: {"errors":[{"code":"UNAUTHORIZED","message":"authentication required, visit https://aka.ms/acr/authorization for more information."}]}
under the following conditions:
az acr health-check -n <myacr> -y
initially failed but by installing both helm and notary in the WSL shell it ran without errors executing a pull along with validating the DNS lookup to the registry, fetch tokens, that the Docker Daemon is available and morecat ~/.docker/config.json
returns two JSON stanzas under auths, one for index.docker.io and the other for my ACR)az acr show --name <myacr>
shows the key publicNetworkAccess as enabled, most policies disabled - nothing that seems offAppreciate any comments or suggestions!
Tried to follow a series of troubleshooting steps that are detailed above to give context to the question.
Upvotes: 0
Views: 124
Reputation: 3781
Further to our discussion in comments, double check that enable admin is properly configured
az acr update -n arkorgacr --admin-enabled true
ensure that the user or service principal you’re using has the correct permissions to push images. Specifically, the permission required is Microsoft.ContainerRegistry/registries/write. You can verify this by checking the roles assigned to your user or service principal. It’s also worth double checking your network settings just to be sure everything is configured correctly.
Clear old docker cache to avoid any conflicts.
Log out and log back in to your acr
docker logout arkorgacr.azurecr.io
docker login arkorgacr.azurecr.io -u arkorgacr -p abcd
After re-authenticating, try pushing a test image to see if everything is working
docker push arkorgacr.azurecr.io/hello-acr:v1
If everything is set up correctly, this should allow you to connect, build, and push your sample image to ACR without encountering further authorization errors.
Found few additional MS docs, check them out once-
Upvotes: 0