Hi, @Alban Vicarini
- Can you share run-time errors?
- Try deploying the Python Flask app according to the following URL (https://learn.microsoft.com/en-us/azure/developer/python/tutorial-deploy-app-service-on-linux-02?tabs=cmd)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello All,
Actually I have tried to deploy my Python Flask app on Linux Azure App Service but after deployment I am not able to access my app application.
Steps:
1) I create Linux base Azure App Service on Azure using Azure Portal in which I select python 3.8.
2) I select free basic version for starting and create service.
3) After successfully creation of Azure App Service I go back to my VS code and in VS code I am able to see this new app service.
4) I right click on the newly create app service and click on deploy
5) After deployment when I tried to access my url I got an error even I am not able to see my deployed code when i use KUDU from Azure App Service.
I have checked many urls and follow same steps but still not successfully deploy my Python Flask app on Linux base Azure App Service.
Can any one help me on this please?
Thank you in advance
Hi, @Alban Vicarini
Thanks for asking question!
In general, The first step in troubleshooting is to use App Service Diagnostics:
In your case it seems there are Application Errors that may have caused the container to crash were detected
Error1:
Could not find virtual environment directory /home/site/wwwroot/antenv.2022-04-07T06:03:22.842783748Z WARNING: Could not find package directory /home/site/wwwroot/__oryx_packages_
_.
Recommended Action: The application maybe facing a generic error which is causing your app to fail proper startup. To access your logs go to https://tennisliveapp.scm.azurewebsites.net/api/logs/docker and review them by opening the files with the words default_docker.log
Error2: ModuleNotFoundError: No module named 'flask_restful' error
Cause: The application maybe missing a Python package which is causing your app to fail proper startup.
Recommended Action: If you see an error like ModuleNotFoundError: No module named 'example'
, this means that Python could not find one or more of your modules when the application started. This most often occurs if you deploy your virtual environment with your code. Virtual environments are not portable, so a virtual environment should not be deployed with your application code. Instead, let Oryx create a virtual environment and install your packages on the web app by creating an app setting, SCM_DO_BUILD_DURING_DEPLOYMENT,
and setting it to 1
.
This will force Oryx to install your packages whenever you deploy to App Service. For more information, please see this article on virtual environment portability.
Further Refer this article to deploy your app properly.
Also, you may requires more than 230 seconds to complete initialization and respond successfully to the Platform's HTTP Ping , we allow you to increase that 230 second wait time up to a limit of 1800
seconds. To configure that, add an app setting called WEBSITES_CONTAINER_START_TIME_LIMIT
and set it to the number of seconds you would like for us to wait for your container to start.
Let us know if further query or issue remains.
If you found a solution share it please, i got the same issue with the deployment. I have already tried to change the Start time limit and put to 1 SCM_DO_BUILD_DURING_DEPLOYMENT. And i still have the same issue.