I have been struggling for days to deploy a Python web app with flask on Azure. But all I ever get is the default page.
This is the address: https://el-priser.azurewebsites.net/ This is my Github repo: https://github.com/Michaelgimm/energinet-elpris
I also tried with the azure guide for a test app, but it does the same.
The deployment is a success and I can see all the files when accessing through SSH via this link: https://el-priser.scm.azurewebsites.net/
Any ideas?
I haave tried everything I can think of. What I did expect to see was my app. In the structure of my app I have a main.py but placed the index.html in a folder called templates.
I have tried to deploy your application to Azure web app through VScode.
I could deploy the application, but I was able to see only default page and few times it also led me to Application Error.

After many trials, I could figure out the resolution for this issue.
To run the deployed Flask application, we have to add few settings in the web app.
Go to your App service=> Settings =>Configuration =>Application Settings=> Click on Add new application settings and add the settings:
1. SCM_DO_BUILD_DURING_DEPLOYMENT=1
2. WEBSITES_CONTAINER_START_TIME_LIMIT=1800
3. WEBSITES_PORT=<port_number_of_your_application>

Go to General Settings in Configuration of your web app and add the startup command gunicorn --bind=0.0.0.0 main:app.
As your Flask app main module is main.py and the Flask app object in that file is named as app, use the above given Startup command.

Response:
I could access both the index and prices pages as shown below:


If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With