1.8 KiB
Azure Image Chooser
Azure Image Chooser is a Streamlit application that allows users to select Azure VM images from the Azure Marketplace.
Azure Image Chooser is written in Python and requires Python interpreter. At the time of writing this, Python 3.13 is the latest.
You can run it on your local machine or deploy to any platform that runs containers. A Docker file and Terraform code to deploy to the Azure are provided.
Running on a local machine
Create a Python development environment file .env:
AZURE_SUBSCRIPTION_ID="subscription_id"
AZURE_CLIENT_ID="client_id"
AZURE_CLIENT_SECRET="client_secret"
AZURE_TENANT_ID="tenant_id"
AZURE_LOCATION="westeurope"
NOTE: Replace the placeholder values with your actual values. Omit
AZURE_CLIENT_ID,AZURE_CLIENT_SECRET, andAZURE_TENANT_IDif you are using Azure CLI authentication.
Execute the following commands to run the app:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install pip --upgrade
pip install -r requirements.txt
cd app
streamlit run image-chooser.py
The app will block terminal and start a web server. Follow the instructions in the terminal to access the app.
Add Certificate Binding for Azure Deployment
Unfortunately, as of now, the Terraform Azure Resource Manager Provider does not support binding certificates to container apps. You can still bind the certificate using the Azure CLI.
# Find the certificate name
CERTIFICATE_LOWERCASE_NAME=$(az containerapp env certificate list -g $RESOURCE_GROUP -n $ENVIRONMENT --query '[].name' -o tsv)
# Bind the certificate to the container app
az containerapp hostname bind --hostname $DOMAIN_NAME -g $RESOURCE_GROUP -n $CONTAINER_APP --environment $ENVIRONMENT --certificate $CERTIFICATE_LOWERCASE_NAME --validation-method CNAME