Visual Studio Team Services provides the easy process to adapt any deployment platform with a lot of options to process your deployment pipeline. Please follow below steps for easy deployment on the windows machine using IIS.
After creating a build definition in VSTS you need to create release definition by selecting Build & Release -> Releases -> click on [+ New definition]
Now In the first tab of pipeline view, you can see your environment servers with attached artifact. You can click on Environment1 (default name) and select the template from the list. I have IIS server so I choose an IIS Website and SQL Database Deployment.
In this example, I created staging environment so give the name like “Staging” and also link artifact generated by the build process.
Now for automated deployment on your IIS server, you need to create one deployment group by click on “Deployment Groups” and give a name in it.
When you create your deployment group, you have to register your server machine to VSTS service and for that, you have to run a shell script with access token given in deployment group detail. You can select your type of operating systems like Windows, Linux or IOS.
After running this script, the agent will be installed on your server and it will be responsible for all your deployment process and take care all your setup of tasks. You can also see the machine in Deployment Groups detail as below. I gave a tag to that server so that can me identified and easily map into release definition.
We have “IIS Web App Manage” in our release definition template so we have all the option to create the web application, web site, virtual directory and also creates an application pool.
I have disabled that task as I have already setup web application in IIS server under Default Web Site as below.
Deploy your package to this application in IIS, we have IIS Web Deploy task. In this task, you need to add the detail of your web site and virtual directory name and also need to select a package file path. I removed SQL Deployment task as well, which not the part of this topic.
Now save this release definition and to test or run it manually click on [+Release] and release has been started in the background and connect to the server machine that we added in our deployment group with matching tag.
You can see the status of a deployment process like IN PROGRESS and when it will be done status has been changed to SUCCEEDED. You can also verify your artifact by Artifacts tab and committed changes in Commits and also can see log and history for that release.
It is connected to build definition and when a new build is ready it will trigger to CD process in which all tasks have been performed and deployed to the server. You can also configure notification and user role management to approve your release package to the server. You can configure multiple environment servers like Development, Staging, and Production. For more detail on multiple environment setups and dynamic configuration to the server please refer below link.