You've mastered CI — code is built, tested, and ready. Now the hard question: how does it get to users? This lesson covers the deployment strategies you'll choose between as an architect.
The Deployment Problem
You have v1 running in production. v2 is ready. How do you switch without:
- ❌ Downtime (users see errors)
- ❌ Corruption (half-old, half-new state)
- ❌ No way back (if v2 is broken, you're stuck)
Different strategies make different tradeoffs. As an architect, you'll pick the right one per service.
Strategy 1: Recreate (Replace)
Strategy 2: Rolling Update
Strategy 3: Blue-Green
Strategy 4: Canary
Decision Framework: Which Strategy When?
| Strategy | Downtime | Rollback | Cost | Complexity |
|---|---|---|---|---|
| Recreate | ⚠️ Yes | Slow (redeploy v1) | 1× | Low |
| Rolling | ✅ None | Moderate (rollout undo) | 1× | Low |
| Blue-Green | ✅ None | Instant (switch back) | 2× | Medium |
| Canary | ✅ None | Instant (shift to 0%) | 1.1× | High |
How These Map to Our Tools
| Strategy | Azure App Service | Kubernetes (AKS) | GitOps (ArgoCD) |
|---|---|---|---|
| Recreate | Default deploy | strategy: Recreate | Default sync |
| Rolling | — | strategy: RollingUpdate | Default sync |
| Blue-Green | Deployment slots | Two Deployments + Service switch | Argo Rollouts |
| Canary | Traffic splitting | Argo Rollouts + AnalysisTemplate | Argo Rollouts |
Since you already know Kubernetes: Rolling Update is the default K8s strategy (what happens with
kubectl apply). Blue-Green and Canary require additional tooling — we'll use Argo Rollouts for these when we reach the GitOps modules.
🧠 Recall Check
- Which strategy has downtime? Which has zero downtime?
- What's the key difference between Blue-Green and Canary?
- Which strategy is the Kubernetes default?
- For a high-traffic payment service, which strategy would you recommend and why?
Reveal answers
- Recreate has downtime. Rolling, Blue-Green, and Canary all have zero downtime.
- Blue-Green switches 100% of traffic at once (all or nothing). Canary shifts traffic gradually (5% → 25% → 50% → 100%), validating at each step.
- Rolling Update —
strategy.type: RollingUpdatein Deployment spec. - Canary. High traffic means a bad deploy affects many users. Canary limits blast radius (only 5% of users see v2 initially) and automated analysis can detect issues before full rollout. The cost of getting it wrong (payment failures) justifies the complexity.
Next lesson: Azure OIDC Authentication — connecting your pipeline to Azure without storing any credentials.