Canary releases with revisions and traffic splits
In this task you'll send a small share of traffic to a new version.
In multiple revision mode a container app keeps several revisions active and splits traffic between them by weight. Send 10% to the new revision, watch errors and latency, then move the weight.
A label gives a revision its own address (app---label.domain), so testers reach it directly.
Example. SS Kaiser released v2 to 10% of shoppers for a day, then 50%, then 100%, and kept v1 active for an hour in case of a quick rollback.
Costs money. This task creates resources that are charged while they exist. Delete them as soon as you finish.
Before you start
You need: A container app. Time: 20 minutes.
Where to look
- Container app
- Application
- Revisions and replicas
Steps
az containerapp revision set-mode -n <app> -g <group> --mode multiple.- Deploy v2 with
--revision-suffix v2. az containerapp ingress traffic set --revision-weight <app>--v1=90 <app>--v2=10.az containerapp revision label add --label canary --revision <app>--v2.
Commands
az containerapp revision set-mode -n ca-shop -g <group> --mode multiple
az containerapp update -n ca-shop -g <group> --image <image>:v2 --revision-suffix v2
az containerapp ingress traffic set -n ca-shop -g <group> --revision-weight ca-shop--v1=90 ca-shop--v2=10
az containerapp revision label add -n ca-shop -g <group> --label canary --revision ca-shop--v2
Watch out for
- Cost
- Two revisions running for a while: pennies more.
- Security
- Both versions must be safe to run side by side, including database changes.
- Common mistakes
- A database migration that v1 can't handle, which turns a canary into an outage.
Clean up
Move 100% to the winner and deactivate the old revision.
Words to know
- Canary
- A new version on a small share of traffic.
- Traffic weight
- The percentage of requests a revision receives.
- Label
- A fixed name and address for one revision.
Tick off each step and track your progress in the guide.
Open this task in DevOps, Hands On