Flask webapp runs locally when started with gunicorn, doesn't work on azure

Genesis 76 Reputation points
2022-02-21T11:57:43.76+00:00

I have a Flask web app which is currently running on azure. I made another one with the exact same file structure, app initialisation, configurations and startup command, yet the second one doesn't run. The error I get in the logs is "no module named 'manage'".

I am really confused since to my knowledge this should be working. Would appreciate any help :)

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
207 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,865 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 18,286 Reputation points
    2022-02-22T05:42:25.113+00:00

    Thanks for asking question! If I am understanding right you have deployed flask linux python web app and having 'No module named 'manage' error.

    If you see an error like ModuleNotFoundError: No module named 'example', this means that Python could not find one or more of your modules when the application started. This most often occurs if you deploy your virtual environment with your code.

    Please note that Virtual environments are not portable, so a virtual environment should not be deployed with your application code.
    Instead, let Oryx create a virtual environment and install your packages on the web app by creating an app setting, SCM_DO_BUILD_DURING_DEPLOYMENT, and setting it to 1.

    This will force Oryx to install your packages whenever you deploy to App Service.

    176657-demo1-microsoft-azure.png

    176636-demo2.png

    176637-demo3-microsoft-azure.png

    For more information, please see this article on virtual environment portability.

    Reference: https://learn.microsoft.com/en-us/azure/app-service/configure-language-python

    Let us know if further query or issue remains.

    0 comments No comments