Continuous Delivery in CI/CD

This section takes a tested build all the way to real users, safely.

  • Deploy through environments with approvals and no stored passwords.
  • Deploy the image to Azure App Service for real, and ship production on a published release.
  • Prove each deploy works with a smoke test.
  • Stop a broken release at staging.
  • Release to a fleet with rolling, blue-green and canary strategies.
  • Roll back to the last good image by itself.

You keep using the same shop app and the same pipeline you built in Continuous Integration.

Lessons in this section

  1. Environments and Secrets

    Deploy through environments with approval rules, keep secrets in the platform, sign in to Azure with OIDC instead of a stored password, and deploy to production only from main after staging.

    • Add environments with approval rules
    • Store secrets in the platform, per environment
    • Replace a client secret with OIDC
    • Deploy to production only from main
  2. Deploy for Real

    Set up Azure App Service once, sign in without passwords, deploy the pushed image, fix wrong app names, and send production only on a published release.

    • Do the one-time Azure setup
    • Deploy a pushed image to App Service
    • Make the deploy wait for the image
    • Fix a wrong app name
  3. Deploy and Smoke Test

    Add a deploy job, check the live app with a smoke test on its health page, retry for slow starts, and stop a broken release at staging before it reaches production.

    • Write a deploy job: get, sign in, deploy
    • Add a smoke test with curl --fail
    • Retry for slow starts without hiding failures
    • Stop production when staging fails
  4. Release Strategies

    Release to a fleet of 10 servers four ways: all at once, rolling, blue-green and canary. Measure the blast radius of a bad release and pick the right strategy.

    • Explain blast radius
    • Run a rolling release with a health check
    • Use blue-green for a one-step undo
    • Run a canary with an error limit
  5. Rollback and Recovery

    Catch a production-only bug, roll back by itself with a failure() job, check the rollback worked, measure time to restore, and choose between rollback, fix forward and feature flags.

    • Explain why some bugs only appear in production
    • Add a rollback job that runs only on failure
    • Verify a rollback with a smoke test
    • Measure time to restore