I've read through this question, which seems to have a similar issue, however the error message is different. I tried the solutions listed there to no avail.
Here's the rub. I have 2 apps that are both publishing to this VM
. An older ASP.NET 4.6 app
which publishes just fine... without any problem at all and the new ASP.NET Core
app which does have the problem. I am using the same settings in the publish of the new app as the old app, except the Site name
which is only different as Default Web Site/OldSite
to Default Web Site/NewSite
. The publish fails. I can manually dotnet publish
then copy the "publish" files manually to the VM
and that works fine. Is this a problem with the ASP.NET Core
publish template
or am I missing something?
Yes, I verified that the user I am trying to connect with is Administrator
in both Windows Users
and Active Directory Admin group
. I've also changed the WMSVC
to run under the same admin user. In my publish settings
User name
I've tried both with domain\username
and username
. Both show a green check mark when I try to Validate Connection
. I am not completely blocked as I can keep manually running dotnet publish
and manually copying, but an actual fix fr this would make my life a bit easier. Please help.
The actual error I get is:
Error count: 1.
More Information: Connected to 'myvm.westus.cloudapp.azure.com' using the
Web Deployment Agent Service, but could not authorize. Make sure you are an
administrator on 'myvm.westus.cloudapp.azure.com'. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error Code: ERROR_USER_NOT_ADMIN
Error: The remote server returned an error: (401) Unauthorized.