1
votes

I am using TFS to Build and Deploy using MSBuild Arguments. I have the following arguments

/P:AllowUntrustedCertificate=True 
/p:DeployOnBuild=True 
/p:DeployTarget=MsDeployPublish 
/p:CreatePackageOnPublish=True 
/p:MSDeployPublishMethod=WMSVC 
/p:MSDeployServiceUrl=https://myserver.com 
/p:DeployIisAppPath="Site1" 
/p:UserName=domain\username
/p:Password=password

This works fine when I use my domain account (which is an Admin on the Destination Server), but I want to use a Service Account that has the barebones permissions to get this to work.

I have already setup IIS Manager Permissions for the site, gave Full Control to the folder that the application sits in, and created setAcl, createApp, and contentPath and iisApp Delegation rules for the user.

I have granted read rights to the inetsrv/config folder, and full control to the applicationHost.config file.

I am able to publish my site using the Visual Studio publish process with that user, but am unable to get the deployment to occur using a TFS Build. When I run the build, I get the following error.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4193): Web deployment task failed. (Connected to the remote computer ("myservercom") 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 credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)

I have looked online and followed all the steps I have seen, but still have the issue. Please let me know if you have any questions.

Thank you in advance

1

1 Answers

0
votes

Try changing your MsDeployServiceUrl to:

https://myserver.com:8172/msdeploy.axd

Failing that, take a look at the Microsoft Web Deploy event log (in Applications and Services Logs)