Deployment & Rollback Runbook
Operator runbook for deploying BookWorm releases, shifting Container App revision traffic, and executing instant rollbacks.
When to Use & Blast Radius
Use this runbook to deploy new infrastructure or application releases to Development, Staging, or Production, shift traffic between Container App revisions, or roll back a broken release. Provisioning and production rollouts modify live Container Apps, identity bindings, and ingress routing.
BookWorm deploys exclusively via aspire deploy or the CI/CD workflow (apphost-cd.yml). Do not
use azd up or manual template deployments. In single-active-revision mode, deploying a new
revision replaces live traffic immediately—verify candidate revisions or enable multiple-revision
mode before shifting production traffic.
Release and Rollback Path
Loading graph...
Pre-Flight Check
Verify Azure authentication, target subscription, and current Container App health before deploying or shifting traffic:
az loginaz account set --subscription "<SUBSCRIPTION_ID>"az containerapp list --resource-group "<RESOURCE_GROUP>" \ --query "[].{Name:name, Status:properties.runningStatus, LatestRevision:properties.latestRevisionName}" -o tableProcedure
Export deployment environment variables (workstation deploys)
Set the target Azure context and external partner connection strings before running
aspire deploy:Terminal window export Azure__SubscriptionId="<SUBSCRIPTION_ID>"export Azure__TenantId="<TENANT_ID>"export Azure__Location="<REGION>"export Azure__ResourceGroup="<RESOURCE_GROUP>"export Azure__CredentialSource="AzureCli"export ConnectionStrings__broker="<KAFKA_CONNECTION_STRING>"export ConnectionStrings__vectordb="<QDRANT_CONNECTION_STRING>"export Parameters__email_smtp_endpoint="smtp://smtp.sendgrid.net:587"export Parameters__email_smtp_username="apikey"export Parameters__email_smtp_password="<SMTP_PASSWORD>"export Parameters__email_sender_address="<SENDER_EMAIL>"export Parameters__email_sender_name="BookWorm Support"Deploy via Aspire CLI or dispatch GitHub Actions
Run
aspire deployfor direct operator releases, or dispatch the CI/CD workflow for audited environment promotion:Terminal window # Option A: Direct CLI deployaspire deploy --environment "<ENV>" --pipeline-log-level information --include-exception-details# Option B: Trigger CI/CD release promotiongh workflow run apphost-cd.yml \-f environment="<ENV>" \-f clear_cache=false \-f pipeline_log_level=informationMonitor CI/CD run status (if using GitHub Actions)
Watch the active workflow run until all build, push, and Container App rollout steps complete:
Terminal window gh run list --workflow=apphost-cd.yml --limit 5gh run watch "<RUN_ID>"Perform staged traffic shifting (optional blue/green)
Switch a target Container App to multiple-revision mode to split traffic between the previous and candidate revisions:
Terminal window az containerapp revision set-mode \--name "<APP_NAME>" \--resource-group "<RESOURCE_GROUP>" \--mode multipleaz containerapp ingress traffic set \--name "<APP_NAME>" \--resource-group "<RESOURCE_GROUP>" \--revision-weight "<PREVIOUS_REVISION>=90" "<REVISION_NAME>=10"Promote candidate revision to 100% traffic
Once smoke checks and error rates remain clean, shift full traffic to the new revision:
Terminal window az containerapp ingress traffic set \--name "<APP_NAME>" \--resource-group "<RESOURCE_GROUP>" \--revision-weight "<REVISION_NAME>=100"
Verification
Confirm all 16 application Container Apps report Running and the API Gateway serves HTTP 200:
GATEWAY_FQDN=$(az containerapp show --name gateway --resource-group "<RESOURCE_GROUP>" --query "properties.configuration.ingress.fqdn" -o tsv)az containerapp list --resource-group "<RESOURCE_GROUP>" \ --query "[].{Name:name, Status:properties.runningStatus, External:properties.configuration.ingress.external}" -o tablecurl -I "https://${GATEWAY_FQDN}/"curl -I "https://${GATEWAY_FQDN}/backoffice"Expected output:
Name Status External------------------- -------- ----------gateway Running Truestorefront Running Falsecommerce Running Falsebackoffice Running Falsecatalog Running False...HTTP/2 200Rollback / Escape Hatch
If a release causes 5xx spikes, probe failures, or broken journeys, immediately shift 100% traffic back to the previous healthy revision or re-run the last known-good CI/CD commit:
# 1. List recent revisions to identify <PREVIOUS_REVISION>az containerapp revision list --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" \ --query "[].{Revision:name, Active:properties.active, Health:properties.healthState, Created:properties.createdTime}" -o table
# 2. Ensure multiple-revision mode is enabled, activate previous revision, and shift 100% trafficaz containerapp revision set-mode --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --mode multipleaz containerapp revision activate --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --revision "<PREVIOUS_REVISION>"az containerapp ingress traffic set --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --revision-weight "<PREVIOUS_REVISION>=100"
# 3. Deactivate the faulty revisionaz containerapp revision deactivate --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --revision "<REVISION_NAME>"To redeploy the previous release from GitHub Actions:
gh workflow run apphost-cd.yml --ref "<PREVIOUS_TAG_OR_COMMIT>" -f environment="<ENV>" -f clear_cache=trueDeleting a resource group permanently destroys all Container Apps, databases, storage accounts, and logs inside it. Never run this against Production.
az group delete --name "<RESOURCE_GROUP>" --yes --no-wait| Symptom | Cause | Fix |
|---|---|---|
Missing parameter error for broker, vectordb, or email | Required environment variable is unset | Export all variables in Step 1 and re-run aspire deploy |
AuthorizationFailed during provisioning | Deploying identity lacks User Access Administrator or Owner | Assign Contributor + User Access Administrator on <SUBSCRIPTION_ID> |
403 or PostgreSQL token login errors right after first deploy | Newly assigned Entra ID RBAC roles take 5–10 minutes to propagate | Wait 10 minutes and restart the failing revision |
| Unexpected resource drift | Cached Aspire deployment state is stale | Re-run aspire deploy with --clear-cache |