Visual Studio failed to publish to Azure Container Registry

Pampua84 6 Reputation points
2025-01-21T15:33:13.06+00:00

Hi,

I have an ASP.NET Core application that I am trying to migrate to Azure. I am using Azure Container Registry to publish my app's images and run it on Container App. Until a few days ago, I was able to successfully push the image to the container registry using Visual Studio's 'Publish Tool'. However, recently, the publication has stopped working: I always get a message saying the publication was successful, but I can't find any published image.

I increased the log level in Visual Studio and consistently see the following error:

CONTAINER1013: Failed to push to the output registry: CONTAINER1008: Failed retrieving credentials for "containerregistryname.azurecr.io": Docker config file doesn't exist.

Unfortunately, for various reasons, I cannot use Docker Desktop on my machine, so I was relying on Visual Studio for publishing. I also checked the logs on Azure Container Registry, but there is nothing related to these failed publication attempts.

Could you please help me? Thank you.

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | C#
{count} vote

2 answers

Sort by: Most helpful
  1. hossein jalilian 11,520 Reputation points Volunteer Moderator
    2025-01-21T18:14:27.3266667+00:00

    Hello Pampua84,

    Thanks for posting your question in the Microsoft Q&A forum.

    It is likely related to authentication problems.

    Open a command prompt and run az login to ensure you're authenticated with Azure, and run az acr login --name <your-registry-name> to authenticate with your ACR.

    Ensure that the admin user is enabled for your ACR. You can do this in the Azure portal under your ACR's Access keys section, If admin user is disabled, enable it temporarily for testing purposes.

    Update the registry credentials with the admin username and password from the ACR Access keys section


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

  2. Raymond Huynh (WICLOUD CORPORATION) 620 Reputation points Microsoft External Staff
    2025-07-10T07:39:58.7366667+00:00

    Hi @Pampua84 ,

    This issue happens because Visual Studio can’t find the credentials it needs to push your Docker image to Azure Container Registry (ACR). This is often due to missing Docker Desktop or not being authenticated with Azure CLI.

    Steps to resolve:

    1. Authenticate with Azure CLI:

    Open Command Prompt or PowerShell and run:

    az login
    

    This will prompt you to sign in to your Azure account.

    2. Log in to your Azure Container Registry:

    Run:

    az acr login --name <your-registry-name>
    

    Replace <your-registry-name> with your actual registry name (not the full URL).

    3. Enable Admin User (if needed):

    In the Azure Portal, go to your Container Registry, then to “Access keys.” Make sure the Admin user is enabled. If not, enable it temporarily and use the provided username and password in Visual Studio’s publish settings.

    4. Restart Visual Studio:

    After completing the above steps, restart Visual Studio to ensure it recognizes the updated credentials.

    Hope this helps!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.