How to get the site-packages in python web app deployed

Farmutd Ecosystems 0 Reputation points
2023-08-14T14:35:02.25+00:00

I created a web app and used zipdeploy to deploy the app. I included the app.py and the requirements.txt file in the zip.. both files for deployed but the packages mentioned in the requirements.txt are not getting deployed. When I run the app using the browser, it complains about missing python modules.

Windows for business Windows Client for IT Pros Devices and deployment Set up, install, or upgrade
Microsoft Security Intune Configuration Manager Deployment
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenLiu-MSFT 49,311 Reputation points Microsoft External Staff
    2023-08-15T01:44:18.97+00:00

    Hi, @Farmutd Ecosystems

    Thank you for posting in Microsoft Q&A forum.

    To ensure that the packages mentioned in the requirements.txt file are deployed when you deploy your Python web app to Azure App Service, you need to enable Azure build automation and set the SCM_DO_BUILD_DURING_DEPLOYMENT app setting to true. This will ensure that Azure installs any necessary requirements and packages the application to run on Azure.

    To enable build automation in Azure, you can follow the instructions in the "Quickstart: Deploy a Python (Django or Flask) web app to Azure App Service" document under the "Deploy your application code to Azure" section. Once you have enabled build automation, you can create a ZIP file of your application that includes the requirements.txt file and upload it to Azure using either Azure CLI or an HTTP client like Postman or cURL.

    References:


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Add comment".

    0 comments No comments

Your answer

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