Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Deployment & Rollback Runbook

Operator runbook for deploying BookWorm releases, shifting Container App revision traffic, and executing instant rollbacks.

Cloud / DevOps

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.

Blast Radius & Deployment Tooling

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:

Terminal window
az login
az account set --subscription "<SUBSCRIPTION_ID>"
az containerapp list --resource-group "<RESOURCE_GROUP>" \
--query "[].{Name:name, Status:properties.runningStatus, LatestRevision:properties.latestRevisionName}" -o table

Procedure

  1. 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"

  2. Deploy via Aspire CLI or dispatch GitHub Actions

    Run aspire deploy for direct operator releases, or dispatch the CI/CD workflow for audited environment promotion:

    Terminal window
    # Option A: Direct CLI deploy
    aspire deploy --environment "<ENV>" --pipeline-log-level information --include-exception-details
    # Option B: Trigger CI/CD release promotion
    gh workflow run apphost-cd.yml \
    -f environment="<ENV>" \
    -f clear_cache=false \
    -f pipeline_log_level=information

  3. Monitor 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 5
    gh run watch "<RUN_ID>"

  4. 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 multiple
    az containerapp ingress traffic set \
    --name "<APP_NAME>" \
    --resource-group "<RESOURCE_GROUP>" \
    --revision-weight "<PREVIOUS_REVISION>=90" "<REVISION_NAME>=10"

  5. 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:

Terminal window
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 table
curl -I "https://${GATEWAY_FQDN}/"
curl -I "https://${GATEWAY_FQDN}/backoffice"

Expected output:

Name Status External
------------------- -------- ----------
gateway Running True
storefront Running False
commerce Running False
backoffice Running False
catalog Running False
...
HTTP/2 200

Rollback / 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:

Terminal window
# 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% traffic
az containerapp revision set-mode --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --mode multiple
az 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 revision
az containerapp revision deactivate --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --revision "<REVISION_NAME>"

To redeploy the previous release from GitHub Actions:

Terminal window
gh workflow run apphost-cd.yml --ref "<PREVIOUS_TAG_OR_COMMIT>" -f environment="<ENV>" -f clear_cache=true