Azure web app service not running flask app

Matej Jakubčík 140 Reputation points
2024-12-19T22:13:50.13+00:00

I uploaded a simple flask app that comunicates with my deployment from azure ai studio but it looks like the flask server isnt running on the azure web app service after deployment. Can you help me resolve this issue?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,931 questions
0 comments No comments
{count} votes

Accepted answer
  1. hossein jalilian 10,825 Reputation points Volunteer Moderator
    2024-12-19T22:30:03.8133333+00:00

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

    To resolve the issue:

    1. Ensure your main Flask file is named either app.py or application.py. Azure App Service looks for these specific filenames by default.
    2. Verify that your requirements.txt file is in the root directory and includes all necessary dependencies, including Flask
    3. Check your app's configuration in Azure portal:
      • Go to your Web App in Azure portal, Navigate to Configuration under Settings
      • Ensure the correct Python version is set , Add an app setting WEBSITE_WEBDEPLOY_USE_SCM with value false
    4. Review your deployment logs:
      • In Azure portal, go to Deployment Center Click on Logs to view any error messages or warnings
    5. Examine application logs:
      • Use the command az webapp log tail --name <app-name> --resource-group <resource-group-name> to check for startup issues
    6. Verify your Flask app runs locally without issues before deploying
    7. If the problem persists, try deploying directly from the Azure portal:
      • Go to App Services , Create a new web app ,Use the Deployment Center to deploy your code
    8. Ensure your app.py doesn't include app.run() as Azure uses the flask run option

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

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.