--- What I'm trying to accomplish ? ---
Hi, I need to deploy a python Dash web app on Azure App service for a project at my job.
I downloaded the dash hello world example app from github here and tried to deploy it following these tutorials :
Deploying Dash to Azure App Service ; Quickstart: Create a Python app in Azure App Service on Linux
--- My environment ? ---
OS : Ubuntu 18.04
Python3.8
--- The part of code posing problem ? ---
I actually don't know.
Here is my requirements.txt
attrs==20.2.0
beautifulsoup4==4.9.3
Brotli==1.0.9
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
colorlover==0.3.0
dash==1.17.0
dash-core-components==1.13.0
dash-html-components==1.1.1
dash-renderer==1.8.3
dash-table==4.11.0
dash.ly==0.17.3
decorator==4.4.2
finsymbols==1.3.0
Flask==1.1.2
Flask-Compress==1.8.0
Flask-SeaSurf==0.2.2
future==0.18.2
gunicorn==20.0.4
idna==2.10
importlib-metadata==2.0.0
ipython-genutils==0.2.0
itsdangerous==1.1.0
Jinja2==2.11.2
jsonschema==3.2.0
jupyter-core==4.6.3
lxml==4.6.1
MarkupSafe==1.1.1
nbformat==5.0.8
numpy==1.19.4
pandas==1.1.4
pandas-datareader==0.9.0
plotly==4.12.0
pyrsistent==0.17.3
python-dateutil==2.8.1
pytz==2020.4
requests==2.24.0
requests-file==1.5.1
requests-ftp==0.3.1
retrying==1.3.3
six==1.15.0
soupsieve==2.0.1
traitlets==4.3.3
urllib3==1.25.11
Werkzeug==1.0.1
wrapt==1.12.1
zipp==3.4.0
And the app.py script
I use Azure CLI to deploy the app. Azure my app service config file:
[defaults]
group = XXXXX
sku = F1
appserviceplan = XXXXX
location = centralus
web = test-surveillance-web-app
--- What I expect the result to be ? ---
After dpeloying the app on Azure App Service, I want to access the web pages when entering the URL
--- What do I actually get ? ---
The page takes a lot of time to load and result in a 502 error.
When I check the logs, I see the following error
2020-11-12T21:01:22.515Z ERROR - Container test-surveillance-web-app_0_4e7cb5d2 for site test-surveillance-web-app did not start within expected time limit. Elapsed time = 255.7862892 sec
**2020-11-12T21:01:22.597Z ERROR - Container test-surveillance-web-app_0_4e7cb5d2 didn't respond to HTTP pings on port: 8050, failing site start. See container logs for debugging.**
2020-11-12T21:01:22.841Z INFO - Stopping site test-surveillance-web-app because it failed during startup.
/home/LogFiles/2020_11_12_lw0sdlwk000014_default_docker.log (https://test-surveillance-web-app.scm.azurewebsites.net/api/vfs/LogFiles/2020_11_12_lw0sdlwk000014_default_docker.log)
**2020-11-12T15:21:06.661995783Z Please update the `dash` module to >= 0.23.1 to use this version of dash_core_components.**
**2020-11-12T15:21:06.662331698Z You are using version 0.17.3**
I don't understand why the container doesn't answer to ping on port 8050 although in my code I listen to that port using the instruction app.run_server(port=8050,debug=True)
In my search for the solution, I saw that the problem can be solved by configuring the following environment variables in app service : PORT and WEBSITES_PORT. I subsequently configured those variables and my code with the 8080, 8000, 8050 et 80 ports, but the error is still present.
I checked all the possible answers already on stackoverflow but none works with me. -_-
Thanks for your precious help