Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying Streamlit App in Azure without using Docker

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.

like image 971
Jeffry Avatar asked Dec 03 '25 04:12

Jeffry


1 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:

  1. Create Azure App service with pricing tier B1 or higher. Free version(F1) doesnt support websocket which is required for Streamlit.

  2. Create a folder for the project. And add requirements.txt with following content.

    streamlit

  3. Deploy this folder to Azure app service.

  4. Make the following configuration change. Under Configuration > General Settings > Startup command provide the following value

    python -m streamlit hello --server.port 8000 --server.address 0.0.0.0

  5. Enable Web Scockets in the Azure App service configuration.

Azure only allows pip binaries to run when used as modules instead of directly. We are mentioning port beacuse by default the service listens to port 8000. We are mentioning the server.address as 0.0.0.0 so that the it can serve all the incoming request from azure infra.

enter image description here

like image 136
Kunal Deo Avatar answered Dec 05 '25 20:12

Kunal Deo