I have an IIS server with MSdeploy installed in order to deploy my site. I'd like to deploy my site in a pipeline on gitlab and so I run the command :
msdeploy -verb:sync -source:package=“\publish\mysite.zip” -dest:auto,computerName=myiisserver,username=admin,password=password,authType=NTLM
msdeploy -verb:sync -source:package=“\publish\mysite.zip” -dest:auto,computerName=myiisserver,username=admin,password=password,authType=Basic
But it gives me an unauthorized 401 error. I've put my admin account under the administrator group, and I've also authorized my admin account on my iis site.
Error Code: ERROR_USER_NOT_ADMIN
More Information: Connected to 'myiisserver' using the Web Deployment Agent Service,
but could not authorize. Make sure you are an administrator on 'myiisserver'. Learn
more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN.
Error: The remote server returned an error: (401) Unauthorized.
Error count: 1.
What's more, I've managed to use Web Deploy from Visual Studio with the same admin account and it deploys perfectly.
Do you have any idea how to solve the problem?
IIS Version : 10.0.0 Web Deploy Version : 4.0.0
You could follow this offical document Web Deploy error codes
Make sure management service is remote connection is enabled and set to allow windows and iis credentials