Share via

web app services in Linux is not running , getting error as Application error

Ganapathy Ram S 0 Reputation points
2025-09-15T16:28:12.91+00:00

I am facing an issue with my Azure Web App for Linux. I have deployed my Python code (using Python 3.11) into the app service, but it is not running.

Here are the details:

App Type: Azure Web App (Linux)

Runtime: Python 3.11

Framework: Flask

Startup Command: flask run

After deployment, the app does not start as expected. Do I need to configure anything additional from my end (like requirements.txt, startup command, or gunicorn configuration) to make this work?

Any guidance or troubleshooting steps would be really helpful.

Thanks in advance!

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Shree Hima Bindu Maganti 7,580 Reputation points Microsoft External Staff Moderator
    2025-09-16T11:03:18.82+00:00

    Hi @Ganapathy Ram S
    To troubleshoot the issue with your Azure Web App for Linux running a Flask application,

    Instead of using flask run, it is recommended to use Gunicorn as the WSGI server for production applications. You can specify a startup command that includes Gunicorn, for example:

       gunicorn --bind=0.0.0.0 --timeout 600 --workers=4 <module>.wsgi
    

    Replace <module> with the appropriate module name.

    Ensure that you have a requirements.txt file in the root of your application. This file should list all the dependencies your application needs. If this file is missing or incorrectly named, the deployment may fail to install the required packages.

    Verify that your app is structured correctly for Azure App Service. Ensure that your Flask application is set up according to the expected structure.

    Check the application logs for any error messages that can provide more insight into why the application is not starting. You can access the logs through the Azure portal or by using the Azure CLI.

    Consider creating an app setting named SCM_DO_BUILD_DURING_DEPLOYMENT with a value of 1. This setting forces the Oryx build process to install your packages whenever you deploy to App Service.

    Following these steps should help you identify and resolve the issue with your application not starting.

    References:

    Was this answer helpful?

    0 comments No comments

  2. hossein jalilian 13,360 Reputation points Volunteer Moderator
    2025-09-15T16:44:28.7933333+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    Azure Web App for Linux requires Flask apps to run with Gunicorn, not flask run.

    • Your app must have app.py (or application.py) with a Flask object named app.
    • Use a startup command like:
        gunicorn --bind=0.0.0.0 app:app
      
    • Ensure requirements.txt includes flask and gunicorn.
    • Set the startup command in Azure Portal and check logs if it fails.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    Was this answer helpful?


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.