Does anyone know how to deploy from the Team Foundation Service to a site hosted on a web server, i.e. not Azure. I have a web site that I can deploy to using Web Deploy and I'd like to deploy to it using Team Foundation Service. I've tried editing the build Workflows, but not had much success. Has anyone managed to do this?
2 Answers
It appears you do this in the same way you would from Team Foundation Server (I'm using 2012 Express). First you need Web Deploy setup on your server (for security I'd advise using a non standard port (example below uses 1234), and get a signed SSL certificate to prevent man in the middle attacks - then change p:AllowUntrustedCertificate=False, or do it over a VPN).
From Visual Studio create a Build Definition (if you haven't already) - then right click and 'Edit Build Definition'.
Click Process / Advanced / MSBuild Arguments.
If you need full parameters you can Google it - though these worked for me: /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=addressofmsdeploy.com:1234 /p:DeployIisAppPath="iisdomain.com" /p:UserName=windowsusername /p:Password=windowspassword /p:AllowUntrustedCertificate=True
After queing a build TFServer should then deploy for you.
This question seems to ask and resolve the same issue:
You need to add this string to MSBuild Arguments in build process in TFS build.
/p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:CreatePackageOnPublish=True /p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=urlToWebDeloy.com /p:DeployIisAppPath="appurl.com" /p:UserName=username /p:Password=password /p:AllowUntrustedCertificate=True