0
votes

I am attempting to deploy asp.net mvc project using web deploy. In visual studio I have setup a profile called dev. I can publish the project through visual studio 2019 no problem.

I am trying to setup deploy using jenkins using pipeline script. My command to deploy looks like:

msbuild /P:PublishProfile=Dev /P:DeployOnBuild=true

This command creates the deployment assets and attempts to publish however fails with error:

MSDeployPublish: Start Web Deploy Publish the Application/package to https://1.1.1.1:8172/msdeploy.axd?site=somesite.someserver.com ... Starting Web deployment task from source: manifest(c:\Code\MyProject\AdminWebsite\obj\Dev\Package\AdminWebsite.SourceManifest.xml) to Destination: auto(). C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.targets(4284,5): msdeploy error ERROR_USER_UNAUTHORIZED: Web deployment task fa iled. (Connected to the remote computer ("1.1.1.1") 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 connecti ng to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)

Note that I can publish using that same profile using visual studio but on same machine via command line i cannot.

Note: I have changed ips and project names etc in this post to obscure my actual settings.

Anyone any ideas?

1
Have you see this? forums.iis.net/post/2006281.aspx Been years since I did something like this.Naeem Sarfraz
The delegation parts are all correct as it does deploy via vs I did find github.com/Microsoft/msbuild/issues/1901 looks like a few people have had thisIsmail

1 Answers

0
votes

So got this working. I updated my command to pass through password like:

msbuild /P:PublishProfile=Dev /p:DeployOnBuild=true /P:Password=12334Ykz#2pE&AJJ

On the command line right at end i was getting AJJ unknown command

So i updated my command to

msbuild /P:PublishProfile=Dev /p:DeployOnBuild=true /P:Password="12334Ykz#2pE&AJJ"

and it works, looks like it did not like the & in password