The container app order-api in resource group rg-ecommerce serves an AI-backed API.
- External ingress is enabled.
- The app is already in multiple revision mode.
- The only revision,
order-api--v1, receives 100 percent of traffic. The traffic rule assigns this weight toorder-api--v1by revision name, so new revisions get no traffic automatically. - A new image has been pushed to
myregistry.azurecr.io/order-api, and you know itssha256digest.
Requirements:
- Production must reference the new image by its immutable digest.
- Testers must validate the new revision before any production traffic reaches it.
- Production traffic must move to the new revision in stages.
- After the move is complete,
order-api--v1must stop consuming resources but must stay available for rollback.
Which actions should you perform, in order?
Your order
You didn't answer this one.
Correct order
1Run
az containerapp update -n order-api -g rg-ecommerce --image myregistry.azurecr.io/order-api@sha256:<digest> --revision-suffix v2 to create revision order-api--v2.2Run
az containerapp revision label add -n order-api -g rg-ecommerce --label canary --revision order-api--v2, and have testers validate the revision through the label URL.3Move production traffic in stages by running
az containerapp ingress traffic set -n order-api -g rg-ecommerce --revision-weight order-api--v1=90 order-api--v2=10, then the same command with --revision-weight order-api--v1=50 order-api--v2=50, and finally with --revision-weight order-api--v1=0 order-api--v2=100.4Run
az containerapp revision deactivate -n order-api -g rg-ecommerce --revision order-api--v1.Why
Deploying the image by digest creates a revision tied to an immutable image identifier. A revision label provides direct access for tester validation while the production traffic weights remain unchanged. After validation, shift production traffic in stages. Finally, deactivate the old revision to stop its replicas while preserving the option to reactivate it for rollback.
- Step 1: Run
az containerapp update -n order-api -g rg-ecommerce --image myregistry.azurecr.io/order-api@sha256:<digest> --revision-suffix v2to create revisionorder-api--v2. Every later step needs the new revision to exist. Updating the image creates that revision, and the digest reference meets the immutability requirement. - Step 2: Run
az containerapp revision label add -n order-api -g rg-ecommerce --label canary --revision order-api--v2, and have testers validate the revision through the label URL. The label needs an existing revision. Its URL lets testers validateorder-api--v2while production traffic continues to reachorder-api--v1. - Step 3: Move production traffic in stages by running
az containerapp ingress traffic set -n order-api -g rg-ecommerce --revision-weight order-api--v1=90 order-api--v2=10, then the same command with--revision-weight order-api--v1=50 order-api--v2=50, and finally with--revision-weight order-api--v1=0 order-api--v2=100. The required tester validation must finish before the new revision receives production traffic. These successive settings provide the staged transition. - Step 4: Run
az containerapp revision deactivate -n order-api -g rg-ecommerce --revision order-api--v1. The old revision must serve its remaining traffic during the transition. Deactivate it after the final traffic shift to stop its replicas while retaining it for rollback. - Not needed: Run
az containerapp revision deactivate -n order-api -g rg-ecommerce --revision order-api--v2after completing the traffic move. This deactivates the revision that should now serve production traffic and leaves the old revision active. The cleanup requirement applies toorder-api--v1. - Not needed: Run
az containerapp revision set-mode -n order-api -g rg-ecommerce --mode single. Single revision mode does not support traffic splitting, so it prevents the required staged production rollout. - Not needed: Run
az containerapp update -n order-api -g rg-ecommerce --image myregistry.azurecr.io/order-api:latest. Thelatesttag can refer to a different image over time and does not meet the requirement to deploy by immutable digest.