Last week I got into trouble when trying to use msdeploy for an ASP.NET Core app. Where I got no problems for the ‘old’ ASP.NET applications, every time I tried to deploy an ASP.NET Core app I got the following error message:
ERROR_USER_UNAUTHORIZED
I logged in on the target server and find a little bit more information in the Event Viewer:
IISWMSVC_AUTHORIZATION_SERVER_NOT_ALLOWED
Only Windows Administrators are allowed to connect using a server connection. Other users should use the 'Connect To Site or Application' task to be able to connect.
I was 100% sure that everything was configured correctly on the server. I used exactly the same steps as for my other applications, the only difference was that this was an ASP.NET Core app.
After some testing, I found an approach that worked for me:
Here are the things I had to change inside my Web Deploy pubxml file:
- Added UseMsDeployExe statement(gave me more control on the parameters passed)
- Added password (as it was not included when applying the UseMsDeploy statement)
- Changed server url development.ordina.be to https://development.ordina.be:8172/msdeploy.axd?site=development.ordina.be