In Azure VM, Dash App deployment problem

Can’t deploy Dash apps directly from Azure VMs?
Do I have to use the App service? I was wondering, in AWS you can deploy directly from a VM.
I can only see the local service of Dash App on Azure VM.

Hello @myidksh,

You should be able to deploy directly from a VM, however it is a little more tricky to setup because you have to work with the network a little bit more.

Why are you wanting to use the VM over the app?

The reason for this is that I want to share the web app with a few people before deploying it as simply as I do in a VM on AWS, and then do the deployment afterward.
And I’m wondering why not in Azure
Thanks.

Hmm, to me it seems more straightforward to use Azure Web App, you can always setup access for only specific users to the endpoint.

For the VM, it would probably be accessible via its external IP address…

The web app will give you an actual url to gain access, plus deploying the app is as easy as hooking it up to your github and syncing.

If you want to make it a bit more professional, you can also work with multiple deployments, like dev, test, and prod. Then you can deploy updates to test and have the few users play around with that before you deploy for real on prod

You can deploy the app with Azure VM but it is a lot simpler with app service. A lot of my Dash apps are deployed with Azure App Service: it containerizes the app for you, redeployments are super easy when synced with your GitHub and you get a free managed SSL cert.

2 Likes

Thank you. It’s a bit complicated, there’s also the constraint of having to use ubuntu 18, presumably Azure has prevented it from running directly in a VM due to security concerns?

Thank you for reading and responding to my post.

You should be able to do it in your already set up vm. Open up the port 8080, install python and pip, create a virtual environment, clone your repo, install requirements.txt. Once everything is installed and you cloned your repo, you should just be able to run python3 app.py from the terminal and access it via the public ip - i.e., <vm-public-ip>:8080

Make sure in app.py that you set the correct host and port app.run(debug=False, host='0.0.0.0', port=8080)

You should probably use gunicorn and nginx but the above should get you started.

Thanks, but I know the method you suggest, unfortunately, in azure, it does not work.

2024년 6월 13일 (목) 오후 11:12, Chris via Plotly Community Forum <notifications@plot.discoursemail.com>님이 작성:

Hey, i have two of my apps running on an azure vps both my django and dash projects. I went that route for some of the same reason you mentioned as an inital testing / quick deployment environment for me to get something live while also still in active development. Before moving it to app services which might be better for scailing up or down as the application hits more traffic.

You can check out the app:
https://dash.geomapindex.com
And

Another reason for using vm thats benificial for my architecture was for deploying both django and dash under the same opporating system to help speed up communications between both centralized apps. The aproach i went to set all this up was to us docker, docker-hub and github pipeline to automate my deployment process to azure. The deployment of dash was the easiest to setup and the docker setup was fairly semplistic i can send you a base dockerfile to use for reference if youd like. Little bit of a pain to initially setup, but ive been pleased with it. Id recommended looking into automatic deployment with github pipelinea and docker-hub if your looking to still use azure vm

1 Like