Right click publish custom docker images to existing ACR with Visual Studio 2019

957 views Asked by At

I get below error when I try to publish DotNet 3.1 web app via Visual Studio 2019 to ACR. I followed this link's instructions to publish but instead of creating new one, I selected existing ACR from list. I also looked in Visual studio to set ACR credentials with any special switches shown in the error, but could not find it.

My Docker Desktop is of version - 2.5.0.1 and VS version is - 16.7.6

Getting below error:

Publish has encountered an error.
Running the docker.exe login command failed.

WARNING! Using --password via the CLI is insecure. Use --password-stdin.

A diagnostic log has been written to the following location:

C:\Users\Admin\AppData\Local\Temp\tmp2719.tmp

Below is full stack trace file which was provided by Visual Studio after failing:

26-11-2020 08:40:30 PM Microsoft.WebTools.Azure.Publish.Docker.DockerCommandException: Running the docker.exe login command failed.

WARNING! Using --password via the CLI is insecure. Use --password-stdin. at Microsoft.WebTools.Azure.Publish.Docker.DockerOperations.ThrowDockerCommandError(String dockerCommand) at Microsoft.WebTools.Azure.Publish.Docker.DockerOperations.d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.WebTools.Azure.Publish.Docker.DockerPublish.d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.WebTools.Azure.Publish.ContainerRegistry.ManageContainerRegistry.d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.WebTools.Azure.Publish.PublishProviders.ContainerRegistryProfileVisual.d__32.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.d__180.MoveNext()

1

There are 1 answers

4
Charles Xu On

According to the message you provided, it shows the docker login failed. As I know when you log in to the Visual Studio, then you can select the Docker support and publish the image to the existing Azure Container Registry if you have the permission to control the ACR. There is no option to set the credential for the ACR. But it gives the login failed error. So the possible reason is that your existing ACR does not enable the admin user. Try to enable the admin user for the ACR and then try to publish again.