Publish Python Web App to Azure App Service (Linux) in Visual Studio 2022

Anthony 25 Reputation points
2025-09-24T18:50:59.9766667+00:00

Hello,

I have a Python Web Project in Visual Studio 2022 17.14. When I right-click my project, select Publish, I select the target as Azure, then on the next page of the Wizard I only have Azure App Service (Windows), Azure Container Registry, and Azure Virtual Machine. I do not have the Azure App Service (Linux) option. I have create the Azure Web App in Linux , I don't think it matters in my case anyhow because I haven't got the option to select that target type from VS.

This is particularly of concern because Linux is the only operating system option for running Python apps in App Service. Python on Windows is no longer supported, as described in App Service Linux Docs - Python Support.

Do you know what the problem is in my case?

User's image

Developer technologies | Visual Studio | Other
Developer technologies | Visual Studio | Other
A family of Microsoft suites of integrated development tools for building applications for Windows, the web, mobile devices and many other platforms. Miscellaneous topics that do not fit into specific categories.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Lizzy Dinh (WICLOUD CORPORATION) 160 Reputation points Microsoft External Staff Moderator
    2025-09-29T07:06:36.17+00:00

    Hi Anthony,

    Thank you for sharing your experience. Based on your insights, I will compile a summary to assist others who may encounter a similar issue, with the hope that your solution will help them resolve it more efficiently.

    For those currently experiencing the absence of the Azure App Service (Linux) option in Visual Studio, utilizing Azure CLI or Visual Studio Code presents a practical alternative. These tools offer enhanced flexibility for deploying Python applications.

    Here are the recommended steps:

    • Prepare Your Project
      • Compress your project files into a .zip archive.
      • Ensure that the archive includes a valid requirements.txt file.
    • Install Azure CLI: If not already installed, download and install the Azure CLI from the official Microsoft documentation.
    • Deploy Using Azure CLI: Execute the following command
        az webapp deploy --resource-group <resourceGroupName> --name <appserviceName> --src-path <path-to-zip-file.zip>
      
    • Configure Environment Variables: In your Azure App Service settings, add this environment variable:

    SCM_DO_BUILD_DURING_DEPLOYMENT = true

    If this solution aligns with your experience, we encourage you to engage with the system to help others facing the same challenge. Your contribution is greatly appreciated and may significantly accelerate resolution for many. Thank you once again for your valuable input.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Lizzy Dinh (WICLOUD CORPORATION) 160 Reputation points Microsoft External Staff Moderator
    2025-09-25T07:14:59.75+00:00

    Hi Anthony,

    Thank you for the screenshots and please accept my apology for any inconvenience regarding this matter. However, I'll be here to assist you with this.

    First step to do is to check if Python development workloads have been installed. If you create your project using this Visual Studio, this workload has been installed, no need to check.

    Secondly, please kindly check and update to the latest version. Some similar issue disappeared after updating from 17.4.x to 17.6.x

    If after that, Linux option is still missing, delete folders starting with 17 in %localappdata%\Microsoft\VisualStudio then restart your computer and try again. To be sure, please also check Tools → Options → Azure Service Authentication and make sure that you have been signed in.

    A little reminder that you need to ensure that you have an Azure subscription and an App Service plan (Linux), Python 3.9 or higher installed locally.

    Please kindly let me know whether your issue is resolve. If you still have any concerns, feel free to leave me a comment, I'll follow up with that.

    Thank you!


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.