AI-200
Azure
Back to Deploy and operate containers on Azure App Service

Project: Example — Deploying a container to Azure Container Apps

Setup and local run

Prerequisites

  • Python 3.12+
  • Azure CLI
  • Docker (optional — ACR can build in the cloud)

Run locally (Python)

Azure CLI
cd quote-api
python -m venv .venv

Windows:

Powershell
.venv\Scripts\Activate.ps1

Linux/macOS:

Azure CLI
source .venv/bin/activate
Azure CLI
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000

Open http://localhost:8000/docs

Run with Docker

Azure CLI
cd quote-api
docker compose up --build

Deploy to Azure

Windows:

Powershell
cd quote-api
.\deploy.ps1

Linux/macOS:

Azure CLI
cd quote-api
chmod +x deploy.sh
./deploy.sh

Set a unique ACR name if needed:

Azure CLI
ACR_NAME=myuniqueacr123 ./deploy.sh

The script creates the resource group, ACR, builds the image, and deploys to Container Apps.

Short notes

  • Local = uvicorn on 8000 or Docker Compose
  • Azure = one-script deploy (deploy.ps1 / deploy.sh)
  • ACR names must be globally unique

Repository

https://github.com/Suralmk/azure-contianers