TeamCity deployment using MSBuild and Web Deploy using Windows Authentication

In the previous post I explained how to deploy web application using Web Deploy and MSBuild using basic authentication (with username and password). But in some cases companies have requirement to use service account for deployment with windows authentication (without providing username/password) Web Deploy support both types of authentication basic and integrated. In case if you want to use integrated authentication you need to change MSBuild parameters a little:

/P:Configuration=%build-configuration%
  /P:DeployOnBuild=True
  /P:DeployTarget=MSDeployPublish
  /P:MsDeployServiceUrl=http://%destination-server%/MsDeployAgentService
  /P:AllowUntrustedCertificate=True
  /P:CreatePackageOnPublish=True
  /P:MSDeployPublishMethod=RemoteAgent
  /p:DeployIisAppPath="Default Web Site"
  /p:AuthType=NTLM
  /P:UserName=

There is not too much difference between parameters from previous post with basis authentication. In this case MsDeployServiceUrl is different and point to MSDeployAgentService which is running after your install Web Deploy on web server, AuthType is NTLM which tells Web deploy to use windows authentication, and UserName parameter is empty (it's important to have it empty, if you do not provide UserName at all the deployment will fail)

After you changed build configuration, you have to change user which is used to run TeamCity build agent. In this case you have to choose some service user who is part of your Active Directory and that user should be Administrator on target Web server



Comments

Social media

Search

Latest Tweets