I have built a flask app which works locally, but generates a 500 intenal error when deployed to azure.

Alexandre Olech 0 Reputation points
2024-03-03T16:52:11.85+00:00

Here is a screenshot of my app.

User's image

And the request code which works locally, but not with my app deployed to azure :

User's image

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

2 answers

Sort by: Most helpful
  1. Dillon Silzer 57,826 Reputation points Volunteer Moderator
    2024-03-03T18:10:15.85+00:00

    Hi Alexandre,

    I would recommend turning on Application Insights (Azure Monitor) to find out where the error is:

    Diagnose exceptions in web apps with Application Insights

    https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-exceptions

    If you have this turned on you will be able to see what error is causing the 500 Gateway error through the Azure portal.

    If this is helpful please accept answer.


  2. VenkateshDodda-MSFT 24,951 Reputation points Microsoft Employee Moderator
    2024-03-04T08:47:23.0733333+00:00

    Hello @Alexandre Olech ,

    I hope the answer shared by Dillon Silzer is helpful. Please let me know if you have any further queries.

    Adding to Dillon Silzer response you can leverage WebApp Down detector under diagnose and solve problems of your app service to identify what is causing this issue.

    Also, you can enable the diagnostic logging in app service, review the application logs to understand better.

    You can also follow the troubleshooting steps mentioned in this guide to troubleshoot 500 error in python app service.

    Please accept as Yes if the answer provided is useful, so that you can help others in the community looking for remediation for similar issues.

    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.