संपादित करें

इसके माध्यम से साझा किया गया


Deploy web apps to an IIS server on a Windows VM

Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019

Learn how to use a Classic pipeline to deploy an ASP.NET Core or Node.js web app to an IIS web server virtual machine (VM) in a Windows deployment group.

Prerequisites

Create a deployment group

A deployment group is a logical set of target machines that each have an Azure Pipelines deployment agent installed. Deployment groups make it easier to organize the servers that you want to use to host your app. Each machine interacts with Azure Pipelines to coordinate the deployment of your app.

To create the deployment group:

  1. From your Azure DevOps project, select Pipelines > Deployment groups from the left menu.

  2. On the Deployment groups screen, select New, or select Add a deployment group if this deployment group is the first one in the project.

  3. Enter a Deployment group name and optional Description, and then select Create.

  4. On the next screen, in the machine registration section, select Windows for the Type of target to register. A registration script is generated.

  5. Select Use a personal access token in the script for authentication. For more information, see Use personal access tokens.

  6. Select Copy script to the clipboard.

    A screenshot showing the generated registration script and other settings.

On each of your target VMs:

  1. Use an account with administrative permissions to sign in to the VM.

  2. To register the machine and install the agent, open an Administrator PowerShell command prompt and run the script you copied.

    When you're prompted to configure optional tags for the agent, press Enter to skip. When you're prompted for the user account, press Enter to accept the defaults.

    Note

    The agent running the pipeline must have access to the C:\Windows\system32\inetsrv\ directory. For more information, see Security groups, service accounts, and permissions.

After you set up a target server, the script should return the message Service vstsagent.{computer-name} started successfully.

On the Targets tab of the Azure Pipelines Deployment groups page, you can verify that the VMs are listed and the agents are running. Refresh the page if necessary.

Create a release pipeline

Deploy the artifacts from your build pipeline to your IIS server by using a release pipeline.

  1. From your Azure DevOps project, select Pipelines > Releases, and then select New > New release pipeline.

  2. On the Select a template screen, search for and select IIS website deployment, and then select Apply.

    A screenshot showing how to add the IIS website deployment template.

  3. In your release pipeline, select Add an artifact.

  4. On the Add an artifact screen, select Build, select your Project and your Source (build pipeline), and then select Add.

  5. On the release pipeline screen, select the Continuous deployment trigger icon in the Artifacts section.

  6. On the Continuous deployment screen, enable the Continuous deployment trigger,

  7. Under Build branch filters, add the main build branch as a filter.

  8. On the release pipeline screen, select Tasks, and then select IIS Deployment.

  9. On the settings screen, under Deployment group, select the deployment group you created earlier.

  10. Select Save.

    A screenshot showing how to set up the IIS deployment group.

Deploy your app

  1. From Pipelines > Releases, select the release pipeline you just created, and then select Create release.
  2. Check that the artifact version you want to use is selected, and then select Create.
  3. Select the release name link in the information bar message Release <release name link> has been queued.
  4. Select View logs to see the logs and agent output.