Is there a way to deploy Streamlit App on Azure App Service without using Docker?
All the guides in the internet refer to Docker virtualization whereas in theory, the Azure Web App should be able deploy the code automatically from Azure Repo. I used “streamlit run app.py” as a startup command in the Azure configuration tab, but nothing really happens.
2
Answers
You can build this out by setting up a normal Steamlit app and throw in the App Service specific configurations to get this going. Here are the exact steps:
Create Azure App service with pricing tier B1 or higher. Free version(F1) doesnt support websocket which is required for Streamlit.
Create a folder for the project. And add
requirements.txt
with following content.streamlit
Deploy this folder to Azure app service.
Make the following configuration change. Under
Configuration > General Settings > Startup command
provide the following valuepython -m streamlit hello –server.port 8000 –server.address 0.0.0.0
Enable Web Scockets in the Azure App service configuration.
To use this to run your app you need to replace "hello" with "run app.py" (assuming the application name is app.py). For me this worked when I put my code on gitHub and signed in, but I failed both when I deployed via VSCode with Azure extensions, or via gitlab. When I did exactly according to this video it worked: https://www.youtube.com/watch?v=2toRzAYT8yo.