Deploys a new custom registry in Azure Container Registry, builds a custom Docker image, and runs the image from the custom registry. The image contains a Streamlit demo app.
-
Create a new stack:
$ pulumi stack init dev
-
Login to Azure CLI (you will be prompted to do this during deployment if you forget this step):
$ az login
-
Create a Python virtualenv, activate it, and install dependencies:
This installs the dependent packages needed for our Pulumi program.
$ python3 -m venv venv $ source venv/bin/activate $ pip3 install -r requirements.txt
-
Specify the Azure location to use:
$ pulumi config set azure-native:location uksouth
-
Run
pulumi up
to preview and deploy changes:$ pulumi up Previewing changes: ... Performing changes: ... Resources: + 5 created Duration: 56s
-
Check the deployed endpoints:
$ open $(pulumi stack output endpoint)
cd app
docker build -t streamlit-app:latest .
docker run -p 8501:8501 streamlit-app:latest
open "http://localhost:8501"
-
PoC uses default Azure domain. In production it will require custom domain and SSL/TLS cert
-
Single dev environment only at present
-
Streamlit's in-memory state handling is potentially not compatible with a scale in/out model in which backend resources are generally considered to be ephemeral. Requires testing.