sqlsolver
sqlsolver

Reputation: 91

Cannot cannot push to Azure Container Registry from WSL (Ubuntu 24.04 LTS)

Receiving an authorization error: unauthorized: {"errors":[{"code":"UNAUTHORIZED","message":"authentication required, visit https://aka.ms/acr/authorization for more information."}]} under the following conditions:

Appreciate 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

Answers (1)

Arko
Arko

Reputation: 3781

Further to our discussion in comments, double check that enable admin is properly configured

az acr update -n arkorgacr --admin-enabled true

enter image description here

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.

enter image description here

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

enter image description here

enter image description here

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.

enter image description here

enter image description here

Found few additional MS docs, check them out once-

Upvotes: 0

Related Questions