Using WebDeploy on Linux App Services

1 minute read | By Keegan D'Souza

This post will cover how to use Web Deploy to Deploy to a Linux App Service, using Visual Studio 2022.

Overview

Web Deploy / MS Deploy is a deployment tool bundled within IIS.

For Linux App Services, normally it is recommend to use zip deploy for most deployment cases. If your team is just deploying for the first time we recommend you stick with this method.

However Web Deploy is supported for Linux App Service, in certain scenarios this can be useful.

For this tutorial we are using a .Net Core 6 application, deploying from Visual Studio 2022

How To

  1. Add the following App setting using the Azure Portal or Azure CLI and save your changes.

    WEBSITE_WEBDEPLOY_USE_SCM = false
    
  2. Navigate to your Deployment Center -> Manage Publish Profile -> Download publish profile.

    Download Publish Profile

  3. Open your publish profile in any editor in a .xml format and take note of the following information the publishProfile value labeled {your app service name} - Web Deploy
    • publishUrl
    • userName
    • userPWD

    Publish Profile Values

  4. Open your project in Visual Studio 2022 and right click on your Solution -> Publish -> + New .

    Publish Profile VS New

  5. Make sure to choose Web Server (IIS)

    Publish Profile VS Web Server Selection

  6. Enter the values you downloaded in step 3 and click Finish.

    Publish Profile VS Enter Config

  7. When you are ready to deploy your application click on Publish, you now should be able to successfully deploy using Web Deploy.

    Publish Profile VS Enter Config

Sample Scenarios.

There are multiple reasons why your team might use Web Deploy instead of the Standard Zip Deploy.

  • Your team has configured access restrictions / private endpoints on your Kudu (Advanced Tools) Site, that will prevent a Zip Deploy Operation.

  • Rare occasions where the Kudu (Advanced Tools) Site is down, your team can use Web Deploy as a mitigation, until the issue is mitigated.

  • Organizational practices or policy to use Web Deploy / Ms Deploy.