IIS Web App Deploy task

Azure Pipelines

Use this task to deploy a website or web app using WebDeploy.

YAML snippet

# IIS web app deploy
# Deploy a website or web application using Web Deploy
- task: IISWebAppDeploymentOnMachineGroup@0
    #virtualApplication: # Optional
    #package: '$(System.DefaultWorkingDirectory)\**\*.zip' 
    #setParametersFile: # Optional
    #removeAdditionalFilesFlag: false # Optional
    #excludeFilesFromAppDataFlag: false # Optional
    #takeAppOfflineFlag: false # Optional
    #additionalArguments: # Optional
    #xmlTransformation: # Optional
    #xmlVariableSubstitution: # Optional
    #jSONFiles: # Optional


Website Name(Required) Provide the name of an existing website on the machine group machines
Virtual Application(Optional) Specify the name of an already existing Virtual Application on the target Machines
Package or Folder(Required) File path to the package or a folder generated by MSBuild or a compressed archive file.
Variables ( Build | Release), wild cards are supported.
For example, $(System.DefaultWorkingDirectory)**.zip.
SetParameters File(Optional) Optional: location of the SetParameters.xml file to use.
Remove Additional Files at Destination(Optional) Select the option to delete files on the Web App that have no matching files in the Web App zip package.
Exclude Files from the App_Data Folder(Optional) Select the option to prevent files in the App_Data folder from being deployed to the Web App.
Take App Offline(Optional) Select the option to take the Web App offline by placing an app_offline.htm file in the root directory of the Web App before the sync operation begins. The file will be removed after the sync operation completes successfully.
Additional Arguments(Optional) Additional Web Deploy arguments that will be applied when deploying the Azure Web App like,-disableLink:AppPoolExtension -disableLink:ContentExtension.
XML transformation(Optional) The config transforms will be run for .Release.config and .<stageName>.config on the .config file.
Config transforms will be run prior to the Variable Substitution.
XML transformations are supported only for Windows platform.
XML variable substitution(Optional) Variables defined in the Build or Release Pipeline will be matched against the 'key' or 'name' entries in the appSettings, applicationSettings, and connectionStrings sections of any config file and parameters.xml. Variable Substitution is run after config transforms.

Note: If the same variables are defined in the release pipeline and in the stage, the stage variables will supersede the Release Pipeline variables.
JSON variable substitution(Optional) Provide new line separated list of JSON files to substitute the variable values. Files names are to be provided relative to the root folder.
To substitute JSON variables that are nested or hierarchical, specify them using JSONPath expressions.

For example, to replace the value of ‘ConnectionString’ in the sample below, you need to define a variable as ‘Data.DefaultConnection.ConnectionString’ in the build/release pipeline (or release pipeline's stage).
  "Data": {
    "DefaultConnection": {
      "ConnectionString": "Server=(localdb)\SQLEXPRESS;Database=MyDB;Trusted_Connection=True"
Variable Substitution is run after configuration transforms.

Note: Build/release pipeline variables are excluded in substitution
Control options

Open source

This task is open source on GitHub. Feedback and contributions are welcome.