Revision Operations¶
This guide focuses on operating revisions in production: activating/deactivating revisions, splitting traffic safely, and performing fast rollbacks.
Prerequisites¶
- App deployed in a Container Apps environment
- A known stable revision available for rollback
Revision Mode Management¶
Use multiple revision mode for canary or A/B releases.
| Command | Why it is used |
|---|---|
az containerapp revision set-mode ... | Runs the Azure CLI operation required by the documented step. |
Review revisions and health state:
| Command | Why it is used |
|---|---|
az containerapp revision list ... | Lists revisions so rollout state, traffic, and health can be verified. |
Use Activity Log for deployment event timeline:
az monitor activity-log list \
--resource-group "$RG" \
--max-events 20 \
--status Succeeded \
--output table
| Command | Why it is used |
|---|---|
az monitor activity-log ... | Creates or inspects Azure Monitor alerts, diagnostic settings, or metrics. |
Traffic Splitting¶
Shift a small percentage to the candidate revision first.
az containerapp ingress traffic set \
--name "$APP_NAME" \
--resource-group "$RG" \
--revision-weight "${APP_NAME}--stable=90" "${APP_NAME}--candidate=10"
| Command | Why it is used |
|---|---|
az containerapp ingress traffic ... | Runs the Azure CLI operation required by the documented step. |
Gradually increase traffic only when SLOs remain healthy.
Rollback Procedure¶
Return 100% traffic to last known good revision:
az containerapp ingress traffic set \
--name "$APP_NAME" \
--resource-group "$RG" \
--revision-weight "${APP_NAME}--stable=100"
| Command | Why it is used |
|---|---|
az containerapp ingress traffic ... | Runs the Azure CLI operation required by the documented step. |
Deactivate failed revision:
az containerapp revision deactivate \
--name "$APP_NAME" \
--resource-group "$RG" \
--revision "${APP_NAME}--candidate"
| Command | Why it is used |
|---|---|
az containerapp revision deactivate ... | Runs the Azure CLI operation required by the documented step. |
Verification Steps¶
| Command | Why it is used |
|---|---|
az containerapp ingress traffic ... | Runs the Azure CLI operation required by the documented step. |
Example output (PII masked):
Troubleshooting¶
New revision is healthy but receives no traffic¶
- Confirm app is in multiple revision mode.
- Check exact revision name from
revision listcommand. - Ensure ingress is enabled before setting traffic weights.
az containerapp show \
--name "$APP_NAME" \
--resource-group "$RG" \
--query "properties.configuration.ingress" \
--output json
| Command | Purpose |
|---|---|
az containerapp show --query "properties.configuration.ingress" | Pulls the full ingress configuration so you can confirm that ingress is enabled and correctly configured before diagnosing why a healthy revision gets no traffic. |
--name "$APP_NAME" / --resource-group "$RG" | Ensures the ingress check is run against the exact app whose revision weights you are troubleshooting. |
--output json | Keeps nested ingress details such as FQDN, transport, and traffic-related configuration visible for operational triage. |
Revision Promotion Workflow¶
flowchart TD
A[Deploy Candidate Revision] --> B[Assign 5-10% Traffic]
B --> C[Observe Errors Latency Restarts]
C --> D{Within SLO?}
D -->|Yes| E[Increase Traffic in Stages]
D -->|No| F[Rollback to Stable Revision]
E --> G[Promote 100% Traffic]
F --> H[Deactivate Failed Revision] | Scenario | Recommended Action | Why |
|---|---|---|
| New feature with unknown risk | Multiple revision mode + staged traffic | Limits blast radius |
| Security hotfix | Fast deploy + focused health checks | Reduces exposure window |
| Runtime regression detected | Immediate traffic rollback | Restores service quickly |
| Stable period after rollout | Deactivate stale revisions | Reduces operational noise |
Name revisions with meaningful image tags
Immutable image tags mapped to commit SHA or release IDs make revision rollback decisions deterministic during incidents.
Microsoft Learn explicitly ties traffic promotion to readiness: in multiple revision mode, "wait until your readiness probes indicate success before you shift traffic to that revision." A revision can exist before it is ready for safe promotion, so validate health, restart count, and error rate before increasing traffic.
Revision Health Validation Commands¶
az containerapp revision list \
--name "$APP_NAME" \
--resource-group "$RG" \
--query "[].{name:name,active:properties.active,replicas:properties.replicas,healthState:properties.healthState,runningState:properties.runningState}" \
--output table
az containerapp ingress traffic show \
--name "$APP_NAME" \
--resource-group "$RG" \
--output table
| Command | Why it is used |
|---|---|
az containerapp revision list ... | Lists revisions so rollout state, traffic, and health can be verified. |
Advanced Topics¶
- Use labels for stable/candidate routing patterns.
- Implement progressive delivery with automated rollback on alert.
- Keep at least one warm standby revision for instant failback.