Application Error

Application error 1 Reputation point
2020-10-26T05:51:06.53+00:00

I had created Rest API with Python+Flask App Service, I tried running in local virtual environment with http://0.0.0.0:5000. It was perfectly working, but when I deployed in cloud, it was not successful, where I was getting Application error, I had tried all of the options mentioned in the documentations as well as your suggestions, I had scaled up also, but nothing worked out, Could you please help me in this regard.

34859-logs.txt

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

1 answer

Sort by: Most helpful
  1. Ryan Hill 28,101 Reputation points Microsoft Employee
    2020-10-26T17:20:46.727+00:00

    Hi @Application error ,

    I looked at your logs attachment. It appears that WEBSITES_PORT you've configured for 5000. Try removing this setting from your application settings. I see that your app is binding port 8372. Port 5000 is normally configured for local development but unless you're using a docker container image that's using EXPOSE 5000, you shouldn't need this setting. I believe that's what's causing your application to not start up.

    Also, app service will look for these files for starting your application. I'm assuming you have an app.py file based on the attached log file, but if that's not case, adjust your startup command to be gunicorn --bind=0.0.0.0 --timeout 600 <your-startup-file>:app. Another thing to do is enable application logging and check your deployment logs to ensure your pip install -r requirements.txt ran without issue.

    If after removing the WEBSITES_PORT app setting and confirming your startup command is correct, please comment below with additional logs.

    Regards,
    Ryan


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.