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

Project: Example — Deploying a container to Azure Container Apps

Environment variables

Setup

Copy the template and edit values:

Azure CLI
cp .env.example .env

Application

VariableDefaultDescription
APP_NAMEQuote APIApplication name
APP_VERSION1.0.0Version string
ENVIRONMENTdevelopmentEnvironment label (development, production)
LOG_LEVELINFOLog level (DEBUG, INFO, WARNING, ERROR)
HOST0.0.0.0Server bind address
PORT8000Server port

Azure deploy (deploy.sh / deploy.ps1)

VariableDefaultDescription
RESOURCE_GROUPquote-api-rgAzure resource group
LOCATIONeastusAzure region
ACR_NAMEquoteapiacrContainer registry name (must be globally unique)
CONTAINERAPPS_ENVquote-api-envContainer Apps environment
CONTAINER_APPquote-apiContainer App name
IMAGE_NAMEquote-apiDocker image name

GitHub Actions (repository secrets)

VariableDescription
AZURE_CREDENTIALSService principal JSON for azure/login@v2
AZURE_RESOURCE_GROUPResource group used in the workflow

Short notes

  • Bind HOST=0.0.0.0 so Azure can reach the process
  • PORT=8000 must match Container Apps --target-port
  • Override ACR_NAME when the default name is already taken

Repository

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