I am trying to deploy a website, initially I had the following command line
MSBuild.exe PortalWeb.sln
/t:Rebuild
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:MSDeployServiceURL=https://wwwt.mycompany.ru:8172/msdeploy.axd
/p:DeployIISAppPath="Portal/test"
/p:CreatePackageOnPublish=False
/p:MsDeployPublishMethod=WMSVC
/p:AllowUntrustedCertificate=True
/p:UserName=DeployUser
/p:Password=123pwd123
/p:Configuration="Testing Env"
Now I am using TFS build server and try to use a web step that generates the following command
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"
-verb:sync
-source:package='PortalWeb.zip'
-dest:auto,computerName='https://wwwt.mycompany.ru:8172/msdeploy.axd?site=Portal/test',userName='DeployUser',password='123pwd123',authType='WMSVC',includeAcls='False'
-allowUntrusted
And this command fails with 401 Unathorized error:
2017-06-06T16:00:12.7928227Z ##[error]System.Management.Automation.RemoteException: Error Code: ERROR_USER_UNAUTHORIZED
2017-06-06T16:00:12.7928227Z ##[error]System.Management.Automation.RemoteException: More Information: Connected to the remote computer ("wwwt.mycompany.ru") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the creden
2017-06-06T16:00:12.7928227Z ##[error]System.Management.Automation.RemoteException: tials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.
2017-06-06T16:00:12.7928227Z Error: The remote server returned an error: (401) Unauthorized.
2017-06-06T16:00:12.7928227Z Error count: 1.
Why one command works with these credentials and the other one fails?