Just following-up from TakahitoIwasa's post - checking in to see if the issue is resolved or you need further assistance.
I understand that you have already tried the suggestions outlined in the Azure docs and watched a few demo videos.
Apologies for any frustration with this.
-- For Flask, App Service looks for a file named application.py or app.py (as in your case) and starts Gunicorn as follows:
gunicorn --bind=0.0.0.0 --timeout 600 app:app
If you haven’t done these already, please validate these:
- Use SSH to connect directly to the App Service container and verify that your files exist under
site/wwwroot. If your files don't exist, use the following steps:
-Create an app setting namedSCM_DO_BUILD_DURING_DEPLOYMENTwith the value of1, redeploy your code, wait a few minutes, then try to access the app again. -- For more information on creating app settings, see Configure an App Service app in the Azure portal. - Review your deployment process, check the deployment logs, correct any errors, and redeploy the app.
--Examine the app log stream for any error messages. The logs will show any errors in the app code. - If your files exist, then App Service wasn't able to identify your specific startup file. Review that your app is structured as App Service expects for your Flask app, or use a custom startup command.
https://learn.microsoft.com/azure/app-service/configure-language-python#customize-startup-command - Be sure you're using App Service for Linux rather than a Windows-based instance. --From the Azure CLI, run the command az webapp show --resource-group <resource-group-name> --name <app-name> --query kind, replacing <resource-group-name> and <app-name> accordingly.
You should see app,linux as output; otherwise, recreate the App Service and choose Linux.
https://learn.microsoft.com/azure/app-service/configure-language-python#flask-app
Kindly let us know how it goes, we will be more than happy to follow-up further.