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

Read the architecture guide →

Scaling & Cost Guardrails

Cloud/DevOps runbook for manual Container App replica overrides, concurrency and KEDA scaling limits, and pausing non-production environments to control spend.

Cloud / DevOps

When to Use & Blast Radius

Use this runbook during planned traffic events, saturation incidents requiring immediate manual scale-out, or off-hours cost optimization in Development and Staging. Lowering minReplicas to 0 introduces cold-start latency; stopping non-production databases makes those environments unavailable until resumed.

Production Availability Guardrail

Never set minReplicas to 0 or stop PostgreSQL Flexible Server in Production. Keep minReplicas >= 1 for all production services and enforce maxReplicas caps to prevent runaway autoscaling spend.

Pre-Flight Check

Inspect current replica counts and scaling bounds across all Container Apps in <RESOURCE_GROUP>:

Terminal window
az account set --subscription "<SUBSCRIPTION_ID>"
az containerapp list --resource-group "<RESOURCE_GROUP>" \
--query "[].{Name:name, MinReplicas:properties.template.scale.minReplicas, MaxReplicas:properties.template.scale.maxReplicas, Status:properties.runningStatus}" \
-o table

Procedure

  1. Apply a manual replica override during traffic spikes

    Temporarily raise min-replicas and cap max-replicas on a saturated Container App (for example, gateway, ordering, catalog, or presidio-analyzer):

    Terminal window
    az containerapp update \
    --name "<APP_NAME>" \
    --resource-group "<RESOURCE_GROUP>" \
    --min-replicas 3 \
    --max-replicas 10

  2. Configure HTTP concurrency scaling guardrails

    Attach an HTTP scaling rule so replicas scale predictably under concurrent request load without exceeding <MAX_REPLICAS>:

    Terminal window
    az containerapp update \
    --name "<APP_NAME>" \
    --resource-group "<RESOURCE_GROUP>" \
    --min-replicas 1 \
    --max-replicas 10 \
    --scale-rule-name http-concurrency \
    --scale-rule-type http \
    --scale-rule-http-concurrency 50

  3. Pause a non-production environment to stop compute spend

    Stop non-production Container Apps and pause the PostgreSQL Flexible Server outside working hours:

    Terminal window
    # Stop all Container Apps in a non-prod resource group
    for app in $(az containerapp list --resource-group "<RESOURCE_GROUP>" --query "[].name" -o tsv); do
    az containerapp stop --name "${app}" --resource-group "<RESOURCE_GROUP>" --no-wait
    done
    # Stop non-prod PostgreSQL Flexible Server (auto-restarts after 7 days per Azure policy)
    az postgres flexible-server stop --name "<POSTGRES_SERVER>" --resource-group "<RESOURCE_GROUP>"

  4. Resume a paused non-production environment

    Start the PostgreSQL Flexible Server first, then start all Container Apps:

    Terminal window
    az postgres flexible-server start --name "<POSTGRES_SERVER>" --resource-group "<RESOURCE_GROUP>"
    for app in $(az containerapp list --resource-group "<RESOURCE_GROUP>" --query "[].name" -o tsv); do
    az containerapp start --name "${app}" --resource-group "<RESOURCE_GROUP>" --no-wait
    done

Verification

Confirm updated replica limits and running state across <RESOURCE_GROUP>:

Terminal window
az containerapp list --resource-group "<RESOURCE_GROUP>" \
--query "[].{Name:name, MinReplicas:properties.template.scale.minReplicas, MaxReplicas:properties.template.scale.maxReplicas, Status:properties.runningStatus}" \
-o table

Expected output (active environment):

Name MinReplicas MaxReplicas Status
--------- ------------- ------------- --------
gateway 1 10 Running
ordering 1 10 Running
catalog 1 10 Running
...

Rollback / Escape Hatch

If a manual scale override or concurrency rule causes instability or unexpected cost, revert to baseline scaling bounds immediately:

Terminal window
az containerapp update \
--name "<APP_NAME>" \
--resource-group "<RESOURCE_GROUP>" \
--min-replicas 1 \
--max-replicas 5