Using WebDeploy on Linux App Services
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
-
Add the following App setting using the Azure Portal or Azure CLI and save your changes.
WEBSITE_WEBDEPLOY_USE_SCM = false
-
Navigate to your Deployment Center -> Manage Publish Profile -> Download publish profile.
- 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
-
Open your project in Visual Studio 2022 and right click on your Solution -> Publish -> + New .
-
Make sure to choose Web Server (IIS)
-
Enter the values you downloaded in step 3 and click Finish.
-
When you are ready to deploy your application click on Publish, you now should be able to successfully deploy using Web Deploy.
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.