0

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()

Godrej
  • 15
  • 1
  • 1
  • 6

1 Answers1

0

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.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • I already have owner rights on my entire Azure Subscription and admin user is already enabled in ACR. I am trying to publish via Visual Studio's inbuilt 'Publish' task which does not give any option to add the ACR admin password and instead relies on my Azure roles which are enough as I can push using docker push command manually. – Godrej Dec 03 '20 at 13:48
  • @Godrej You can see this [article](https://learn.microsoft.com/en-us/visualstudio/containers/hosting-web-apps-in-docker?view=vs-2019). When you login the Visual Studio with your Azure Account, then visual studio use your Azure ACcount to get the existing ACR or create a new one and publish the image to the ACR. So you don't need to add the credential manually. – Charles Xu Dec 04 '20 at 07:00
  • exactly. I follow this way only and have subscription owner rights and still it fails to deploy as explained above. – Godrej Dec 05 '20 at 08:04
  • @Godrej It works fine on my side. Can you share the page that you publish the image to ACR and the access key page for the ACR? I need to confirm. – Charles Xu Dec 07 '20 at 06:48