Deploy apps to a Windows Virtual Machine
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019 | TFS 2018
Learn how to use Azure Pipelines to build and deploy your ASP.NET, ASP.NET Core, or Node.js web app to an IIS web server running on a Windows Virtual Machine.
- An Azure DevOps Organization. Create an organization, if you don't have one already.
- Build pipeline
- Configure IIS web server
Set up a build pipeline if you don't have one already.
Configure IIS web server
Configure your IIS server if you haven't done so already
In an elevated PowerShell command prompt window, run the following command to install IIS:
Create a deployment group
Deployment groups make it easier to organize the servers that you want to use to host your app. A deployment group is a collection of machines with an Azure Pipelines agent on each of them. Each machine interacts with Azure Pipelines to coordinate the deployment of your app.
Select Pipelines, and then select Deployment groups.
Select Add a deployment group (or New if there are already deployment groups in place).
Enter a name for your group, and then select Create.
In the machine registration section, make sure that Windows is selected from the dropdown menu, and that the Use a personal access token in the script for authentication checkbox is also selected. Select Copy script to clipboard when you are done. The script that you've copied to your clipboard will download and configure an agent on the VM so that it can receive new web deployment packages and apply them to IIS.
Log in to your VM, open an elevated PowerShell command prompt window and run the script.
When you're prompted to configure tags for the agent, press Enter to skip. (tags are optional)
When you're prompted for the user account, press Enter to accept the defaults.
The agent running the pipeline must have access to the *C:\Windows\system32\inetsrv* directory. See Security groups, service accounts, and permissions for more details.
You should see the following message when the script is done Service vstsagent.account.computername started successfully.
Navigate to Deployment groups, and then select your deployment group. Select the Targets tab and make sure your VM is listed.
Create a release pipeline
Using release pipelines, you can deploy your build artifacts to your IIS servers.
Select Pipelines, and then select Releases. Select New pipeline.
Select the IIS Website Deployment template, and then select Apply.
Select Add an artifact to add your build artifact.
Select Build, and then select your Project and your Source (build pipeline). Select Add when you are done.
Select the Continuous deployment trigger icon in the Artifacts section. Enable the Continuous deployment trigger, and add the main branch as a filter.
Select Tasks, and then select IIS Deployment. Select the deployment group you created earlier from the dropdown menu.
Select Save when you are done.
Deploy your app
Select Pipelines > Releases, and then select Create release.
Check that the artifact version you want to use is selected and then select Create.
Select the release link in the information bar message. For example: "Release Release-1 has been queued".
Navigate to your pipeline Logs to see the logs and agent output.
Submit and view feedback for