Visual Studio failed to publish to Azure Container Registry


I created sample Asp.net core Application and published to Azure Container Registry using Visual Studio without Docker desktop I got the error.

There is an alternative method to push the image to Azure Container Registry using Azure CLI.

Open Command Prompt Run the Az login command and follow the Authentication process.

By running the below command, you will get an access token:

az acr login --name <ACRName> --expose-token

After obtaining the access token, use the following command to log in to ACR:

docker login <ACRName>.azurecr.io -u 00000000-0000-0000-0000-000000000000 -p <accessToken>

Finally run the below command to build and push the image to Azure Container Registry.

az acr build --registry <ACRName>.azurecr.io --image webapp6:latest --file path/to/Dockerfile path/to/project.

I was successfully pushed my image to ACR without Docker Desktop.

enter image description here

Below is my image:

enter image description here

Leave a Reply

Your email address will not be published. Required fields are marked *