Deployment strategies

AZ-400 DevOps EngineerBuild and release pipelinesAbout 30 minutesBy Cloud Hands On

Blue-green, canary, ring, progressive exposure, feature flags and A/B testing; ordering, downtime, hotfixes, resiliency, containers and databases.

In this lesson you'll learn

1. Strategies

StrategyHowRollback
Blue-greenDeploy to the idle copy, test it, switch traffic (App Service slot swap, load balancer)Switch back
CanarySend a small share of traffic to the new version, watch metrics, widenMove traffic back
RingRelease to groups in turn: internal staff, early adopters, everyoneStop the rollout
Progressive exposureThe general idea of widening exposure step by step (canary and rings are forms of it)Stop widening
Feature flagsDeploy code dark, switch the feature on separately, for some usersTurn the flag off
A/B testingShow two variants to different users to compare a business metricEnd the experiment

A/B testing is about which version works better; canary is about whether the new version is safe.

2. Feature flags

Azure App Configuration has a Feature Manager: flags with filters such as percentage (targeting a share of users), time window, or targeting specific users and groups. Apps read flags with the feature management libraries and refresh without redeploying. Flags separate deploy from release, and need cleaning up once a feature is fully on.

3. Downtime and order

  • Load balancing and rolling deployments: update instances a few at a time, taking each out of the load balancer while it updates.
  • Deployment slots: deploy to staging, warm up, then swap; slot settings (marked sticky) stay with their slot.
  • Dependency order: in a pipeline, deploy what others depend on first (database, then API, then front end) using stages with dependsOn, and make changes backwards-compatible so order mistakes don't break things.

4. Hotfixes and resiliency

A hotfix path is a planned fast route for urgent fixes: a branch from the released version (or main in trunk-based teams), the same automated tests, an expedited approval and a pipeline that can deploy straight to production, then merging the fix back. Skipping tests in a panic is how one incident becomes two.

A resilient deployment has health checks, automatic rollback on failure, deployments to several regions or zones, retries for transient errors, and idempotent scripts that can run twice safely.

5. What gets deployed

  • Containers: build the image once, push to a registry with an immutable tag (commit SHA), deploy that tag to App Service, Container Apps or AKS.
  • Binaries: publish the build output as a pipeline artifact; deploy with tasks such as AzureWebApp.
  • Scripts: Azure CLI or PowerShell tasks, signed in through a service connection.
  • Databases: schema changes as code (SQL projects with DACPAC, or migrations such as Entity Framework or Flyway), deployed by the pipeline before the app, with backups and backwards-compatible changes (expand, then contract).

Example

Ironbridge Payments deploys its API to a staging slot, runs smoke tests and swaps. A new checkout flow ships behind an App Configuration flag at 5% of users; the team watches error rates for a day, then widens to 50% and 100%, and removes the flag the next sprint.

Exam traps to remember

  • A/B testing compares variants for business results; canary checks safety.
  • Feature flags separate deployment from release; App Configuration's percentage filter does gradual rollout.
  • Database changes go first and stay backwards-compatible.

Test yourself: 3 check questions and exam-style practice questions on this topic are in the AZ-400 DevOps Engineer app.

Practise in the app

Keep going