5
votes

I am using VSTS Release management to deploy artifacts to IIS websites. I have several Web applications and web services to be deployed. So, i am trying to figure out what sort of tasks that best fits my situation.

I have created a build definition with Visual Studio Build Task for projects as this one: enter image description here

which works fine but i need to add a task for copying the artifacts Under IIS Website Directory.

The other approach is to use IIS web deployment as a task in Release definition, so I created the build definition as:

enter image description here

However, it expects a Publish Profile (the build fails because it can't find it). I don't need to create a publish profile for each project in the application because this would be too much work.

Is there is a workaround for that or what is preferred approach for this?

3

3 Answers

3
votes

You can update your build definition to generate a web deployment package and upload it to artifacts. And then in Release Management, add a task to run "projectname.deploy.cmd" in the deployment package to deploy it to your IIS server. Refer to this link for details: How to: Install a Deployment Package Using the deploy.cmd File Created by Visual Studio.

And you can also enable FTP Publishing on your IIS server and add a task in your release to publish the artifacts via FTP. You may need this task: FTP Uploader.

3
votes

My Continuous Delivery with TFS / VSTS – Server Configuration and Application Deployment with Release Management blog post (with reference to some previous posts) has all the details you need for deploying your artefacts to target nodes using Windows Machine File Copy tasks then use PowerShell on Target Machines tasks to get them in to correct locations and to do token replacement and anything else that's required.

I would recommend using PowerShell DSC so that IIS is properly configured before deployment but that's not required. Where possible for web apps I favour keeping things very simple by creating artefacts that contain all the web files that are needed for a particular folder and then just using plain xcopy for the deployment.