Trying to deploy a Dash app on Azure Web app

I have been trying for days to deplpy a dash app on an Azure web app. I have tried following guides (for example this) but I failed, both deploying via Github or via Azure CLI.

My app is quite simple, it uses a Dash object named app and in the main I have:

if __name__ == '__main__':
    server = app.server 
    app.run_server()

Then, I do az webapp up (or Github whatever) and I upload it on a Webapp. Nothing. I even tried to set up the startup command from the web app to call gunicorn but it didn’t work. My application doesn’t start, I get application error (same here).
The deployment is ok (no errors on the logs).

I hoped that this part would be the simplest (I have set up before my Azure functions and Synapse to retrieve and process the data) but I was evidently wrong.

Do you have ideas or complete working examples to share?

Hello @matteodefelice,

Thank you for creating another topic.

Try this instead:

server = app.server 

if __name__ == '__main__':
    app.run_server()

Thank you for your reply. I have tried with this but I still get the Application Error once setting gunicorn app:server

Are all your requirements downloading properly, can you run your app locally if using gunicorn, or running the server via waitress?

Honestly, I always try to test my Dash app just running the app from Python (python app.py). I don’t know other ways…should I try then using gunicorn locally on my windows machine?

Yes, to see if your configuration runs under normal circumstances.

If you can’t use waitress with the server, then something isn’t right with your app set up. If it runs, it may be an issue with your Azure app installing the requirements.txt.