Search code examples
deploymentazure-devopsazure-web-app-servicewebdeploymsdeploy

Invoking MsDeploy.exe manually in a Azure Devops


Background

As part of our deployment pipeline we are creating our deployment artifact, by running several .xdt transforms on our build artifact as well as adding several additional files.

As the last step before publishing, we would like to invoke msdeploy.exe to build a "custom" webdeploy package from a folder containing the wwwroot-content - (msdeploy command for creating custom package found in this question Web Deploy - How to create a package with selected items)

We are using hosted agents (win 2017).

We wish to deploy to an Azure AppService.

Question

Is there a task in Azure DevOps, that allows you to invoke MsDeploy.exe manually, such that we can create a custom webdeploy package, before we deploy?


Solution

  • Is there a task in Azure DevOps, that allows you to invoke MsDeploy.exe manually, such that we can create a custom webdeploy package, before we deploy?

    I am afraid there is no such task to invoke MsDeploy.exe manually. We need invoke it by command line task, just like Daniel comment.

    As we know, the default installation will place msdeploy.exe in:

    C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe
    

    To verify the msdeploy path on the hosted agents, I use a copy task with content **\msdeploy.exe:

    enter image description here

    Then use the Publish build artifacts to output the msdeploy.exe, I could get the result on the hosted agent vs2017-win2016 and windows-2019:

    enter image description here

    So, the the msdeploy path on the hosted agents vs2017-win2016 and windows-2019 is C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe. We could use command line task to invoke it.

    Hope this helps.