Study guide
9.5 Ordered Dependency Deployments, Resiliency & Rollback
Microsoft Certified: Azure DevOps Engineer Expert AZ-400
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Flow of Work, Traceability & Work Tracking
1.1 Flow of Work, GitHub Flow & Feedback Cycles 1.2 Work Tracking with Azure Boards & GitHub Projects 1.3 End-to-End DevOps Traceability & Quality Tracking
2 Chapter 2: DevOps Metrics, Dashboards & Team Collaboration
2.1 DORA Metrics, Flow Metrics & Dashboard Design 2.2 Lifecycle Metrics Across the Six DevOps Phases 2.3 Work Item Queries, WIQL Charts & Analytics 2.4 Project Documentation: Wikis, Mermaid Diagrams & Release Notes 2.5 Webhooks, Service Hooks & Microsoft Teams ChatOps
3 Chapter 3: Git Branching Strategies & Pull Request Workflows
3.1 Git Branching Models & Strategy Design 3.2 Pull Request Workflows & Merge Strategies 3.3 Branch Policies, Quality Gates & Compliance Restrictions
4 Chapter 4: Repository Management, Optimization & Git Data Operations
4.1 Git LFS Architecture & .gitattributes Tracking 4.2 LFS History Migration, git-fat & File Locking 4.3 Git Repository Scaling, Scalar & Monorepo Governance 4.4 Repository Permissions & Git Tag Governance 4.5 Git Data Recovery & Sensitive-Data Scrubbing
5 Chapter 5: Package Management & Dependency Versioning
5.1 Selecting Package Tools: Azure Artifacts vs. GitHub Packages 5.2 Feed Scoping, Upstream Sources & Pipeline Authentication 5.3 Package Views, Immutability & Quality Promotion 5.4 Dependency Versioning: SemVer, CalVer & Automated Versioning 5.5 Pipeline Artifact Versioning & Artifact Storage Strategy
6 Chapter 6: Pipeline Infrastructure, Agents & Integration
6.1 Selecting a CI/CD Solution: Azure Pipelines vs. GitHub Actions 6.2 GitHub-Azure Pipelines Integration & Hybrid Migration 6.3 Hosted vs. Self-Hosted Agents & Runners 6.4 VMSS Elastic Pools, Container Jobs & Agent Governance 6.5 Pipeline Triggers, Filters & Concurrency Management
7 Chapter 7: YAML Pipeline Architecture & Reusable Elements
7.1 YAML Pipeline Anatomy: Stages, Jobs, Steps & Workspaces 7.2 Job Execution Order: DAG Dependencies, Parallelism & Conditions 7.3 Reusable Elements: Templates, Parameters & Variables 7.4 Variable Groups, Secret Variables & Key Vault Linking 7.5 YAML Environments, Checks & Deployment Approvals
8 Chapter 8: Testing Strategy, Quality Gates & Code Coverage
8.1 Test Strategy Design: Local, Unit & Integration Testing 8.2 Load, Stress & Performance Testing in Pipelines 8.3 Test Execution Tasks, Agents & Results Integration 8.4 Code Coverage Analysis & SonarQube Integration 8.5 Quality Gates, Release Gates & Governance Checks
9 Chapter 9: Modern Deployment Strategies & Zero-Downtime Delivery
9.1 Progressive Delivery: Blue-Green, Canary & Ring Deployments 9.2 Minimizing Downtime: Deployment Slots & Rolling Updates 9.3 Feature Flags with Azure App Configuration & Feature Manager 9.4 Designing the High-Priority Hotfix Path 9.5 Ordered Dependency Deployments, Resiliency & Rollback
10 Chapter 10: Artifact Deployment & Database DevOps
10.1 Containerized Application Delivery: ACR, AKS & Container Apps 10.2 Binary, Web App, Function & Scripted Deployments 10.3 Database DevOps: State-Based & Migration-Based Strategies
11 Chapter 11: Infrastructure as Code (IaC) & Azure Deployment Environments
11.1 Infrastructure as Code Strategy: Bicep, ARM & Terraform 11.2 Desired State Configuration & Azure Machine Configuration 11.3 Azure Deployment Environments (ADE) & Developer Self-Service
12 Chapter 12: Pipeline Maintenance, Health & Modernization
12.1 Pipeline Health, Flaky Tests & Reliability Engineering 12.2 Pipeline Optimization: Caching, Slicing & Concurrency 12.3 Artifact & Build Retention Governance 12.4 Modernizing CI/CD: Classic to YAML Migration
13 Chapter 13: Authentication, Authorization & Identity Governance
13.1 Microsoft Entra Service Principals & Managed Identities 13.2 Service Connections, Workload Identity & Personal Access Tokens 13.3 Azure DevOps Projects, Teams & Permission Evaluation 13.4 Access Levels, GitHub Roles & Outside Collaborators
14 Chapter 14: Secrets Management, Sensitive Data & DevSecOps Scanning
14.1 Azure Key Vault, Secret Variables & Secretless CI/CD 14.2 Security Scanning Strategy, GHAS & Secret Scanning 14.3 CodeQL SAST in Pipelines and Containers 14.4 Software Supply Chain, Container Scanning & Cloud Defender
15 Chapter 15: Telemetry Collection, Azure Monitor & Alerting
15.1 Azure Monitor Architecture, AMA & Data Collection Rules 15.2 Application Insights & Specialized Azure Monitor Insights 15.3 Alerting Rules, Action Groups & GitHub Repository Insights
16 Chapter 16: Telemetry Analysis, Distributed Tracing & SRE Practices
16.1 Distributed Tracing, Application Map & Exception Triage 16.2 KQL Log Analytics, SRE Observability & Error Budgets
9.5 Ordered Dependency Deployments, Resiliency & Rollback
Key Takeaways Explain This Topic AI
dependsOn between stages is the mechanism that guarantees a database migration completes before the application that requires it deploys.
A fan-in stage that depends on several upstream stages will not start until all of them succeed, enforcing an all-or-nothing promotion.
Health check probes and post-deployment gates verify live telemetry before promotion, converting a silent bad release into a blocked one.
An automated rollback stage conditioned on failed() redeploys the last known-good artifact; keeping that artifact retained is what makes rollback possible.
Circuit breakers, bulkheads and graceful degradation limit blast radius at runtime, complementing pipeline-level rollback rather than replacing it.
Last updated: September 2026
9.5 Ordered Dependency Deployments, Resiliency & Rollback
A hotfix fixes one component. A release usually touches several, and the pipeline itself has to encode the ordering contract between them - then survive the case where one of those stages fails in production.
1. Dependency-Ordered Pipeline Deployments
In complex microservices and distributed cloud architectures, applications cannot be deployed simultaneously in random order. Deploying a front-end API gateway before the back-end services are available causes immediate client 502 Bad Gateway errors; deploying a microservice before its database schema exists causes startup crashes.
DevOps architects model these relationships using Topological Dependency Ordering in Azure Pipelines multi-stage YAML definitions via the dependsOn keyword. [Stage 1: Foundation Infrastructure]
- (VNet, Key Vault, Service Bus Topics)
- │
- ▼
- [Stage 2: Database Schema Migration]
- (Backward-Compatible Expand Script)
- │
- ┌────────────────────┴────────────────────┐
- ▼ ▼
- [Stage 3A: Billing Microservice] [Stage 3B: Order Microservice]
- │ │
- └────────────────────┬────────────────────┘
- ▼
- [Stage 4: API Management Gateway]
- (Update Routing Rules to New Service Endpoints)
- Stage Dependency Rules in Azure Pipelines
Sequential Execution : Declaring dependsOn: StageA ensures StageB will not start until StageA completes successfully.
Parallel Execution (Fan-Out) : If multiple stages declare dependsOn: Stage2 (like BillingService and OrderService above), Azure Pipelines runs them concurrently across available agents, reducing overall pipeline execution time.
Synchronization (Fan-In) : Stage 4 declares dependsOn: [BillingService, OrderService] . It waits until both parallel microservice deployments finish before updating the API Gateway.
Conditions : By default, dependent stages only run if previous stages succeed ( condition: succeeded() ). If the database migration fails, all subsequent application stages are aborted automatically.
2. Resilient Pipelines, Health Gates & Automated Rollbacks
Automated rollbacks are essential for maintaining high availability SLAs. Relying on an on-call engineer to notice a failure, log into the Azure portal, and manually execute a rollback during an off-hours incident increases MTTR from seconds to tens of minutes.
Health Check Probes in Pipeline Environments
Azure DevOps YAML multi-stage pipelines integrate with Environments that enforce automated Checks & Approvals :
Azure Monitor Alerts Gate : The pipeline queries active Azure Monitor alerts. If any Sev1 or Sev2 alerts (e.g., HTTP 500 error spike or database DTU saturation) fire during or immediately after deployment, the environment gate fails.
REST API Health Check Gate : The pipeline issues recurring HTTP GET requests to the application's /healthz or /ready endpoint, confirming deep dependency reachability (SQL connection pool, Redis cache ping, message queue access).
Automated Rollback Stage Architecture
When an error occurs during a multi-stage deployment, Azure Pipelines supports automated recovery stages governed by the condition: failed() expression: stages:
- stage: DeployToStaging
- displayName: 'Deploy to Staging Slot'
jobs:
- deployment: DeployWeb
- environment: 'Production-Staging'
strategy:
runOnce:
deploy:
steps:
- task: AzureWebAppDeployment@1
inputs:
- appName: 'app-contoso-core'
- deployToSlotOrASE: true
- resourceGroupName: 'rg-contoso'
- slotName: 'staging'
- package: '$(Pipeline.Workspace)/drop/*.zip'
- stage: SwapAndValidate
- displayName: 'Swap Slots and Evaluate Health'
- dependsOn: DeployToStaging
jobs:
- job: ExecuteSwap
steps:
- task: AzureAppServiceManage@0
- displayName: 'Swap Staging to Production'
inputs:
- Action: 'Swap Slots'
- WebAppName: 'app-contoso-core'
- ResourceGroupName: 'rg-contoso'
- SourceSlot: 'staging'
- SwapWithProduction: true
- stage: AutomatedRollback
- displayName: 'Automate Rollback on Deployment Failure'
- dependsOn: SwapAndValidate
condition: failed() # Only executes if SwapAndValidate fails!
jobs:
- job: RevertSwap
steps:
- task: AzureAppServiceManage@0
- displayName: 'Revert Production Slot Swap'
inputs:
- Action: 'Swap Slots'
- WebAppName: 'app-contoso-core'
- ResourceGroupName: 'rg-contoso'
- SourceSlot: 'staging'
- SwapWithProduction: true
- script: |
- echo "ALERT: Production deployment failed health validation. Automated slot swap reversal executed."
If the validation steps in SwapAndValidate fail or report an unhealthy state, Azure Pipelines immediately activates AutomatedRollback , executing a reverse slot swap that restores the previous working version within seconds.
3. Circuit Breakers, Bulkheads & Graceful Degradation
Modern cloud-native resilience extends beyond CI/CD pipelines into application architecture. During rolling deployments or partial infrastructure failovers, distributed systems face transient faults. [Client Request] ──► [API Gateway]
- │
- ▼
- [Circuit Breaker State Machine (Polly)]
- ┌────────────────────────────────────────────────────────┐
- │ • CLOSED: Normal operation; requests forwarded │
- │ • OPEN: Failure threshold exceeded; fast-fail fallback │
- │ • HALF-OPEN: Trial requests test if downstream healed │
- └────────────────────────────────────────────────────────┘
- │
- ▼
- [Downstream Microservice (Undergoing Deployment)]
- The Circuit Breaker Pattern
Implemented via libraries such as Polly (.NET) or Resilience4j (Java), the circuit breaker prevents an application from repeatedly executing operations that are likely to fail:
Closed : Requests pass through normally. The breaker tracks recent failures.
Open : If the failure rate breaches a threshold (e.g., 50% failures over 10 seconds), the circuit "trips" open. Subsequent requests fail immediately without hitting the struggling downstream service. The application returns a cached response, degraded data, or a fallback message. This prevents thread starvation and database connection pool exhaustion.
Half-Open : After a configured sleep duration, the breaker allows a limited number of trial requests through. If they succeed, the circuit resets to Closed; if they fail, it trips back to Open.
- 4. Realistic Exam Scenario & Common Traps
- Scenario: Global Airline Booking Engine Failure
Organization : An international airline deploys an emergency hotfix to resolve a seat reservation glitch in their production booking service ( v4.1.0 ).
Incident Sequence :
The on-call engineer fixes the code on a branch created from main , rather than the production release branch.
In the rush, the engineer disables database migration dependency ordering, triggering the API gateway update and the SQL schema script simultaneously.
When deployed, the API Gateway immediately routes live traffic to the new container pods before the SQL script finishes, causing 10,000 reservation requests to fail with database constraint errors.
Three weeks later, after manually fixing production, the team deploys scheduled release v4.2.0 from main . Because the original hotfix was never merged back into main properly, the original seat reservation glitch re-appears, stranding thousands of passengers.
DevOps Solution Required :
Branching : Branch emergency fixes exclusively from the production release tag ( release/v4.1.0 ).
Topological Ordering : Structure the multi-stage pipeline so that microservices declare dependsOn: DatabaseMigration , guaranteeing that schema updates finish before web containers start.
Automated Rollback : Add a rollback stage with condition: failed() to swap deployment slots back if post-swap health probes fail.
Mandatory Merge-Back : Mandate a pull request that cherry-picks the hotfix commit into main before closing the incident ticket.
Common Exam Traps to Avoid
Trap: Branching emergency hotfixes from the main branch. main contains unreleased sprint code. Always branch hotfixes from the production release branch or tag.
Trap: Forgetting to merge hotfixes back to main . Deploying a hotfix to a release branch without cherry-picking or merging it back to main guarantees a regression in the next general release.
Trap: Conflating manual approvals with automated rollback gates. Manual approvals pause pipelines before deployment. Automated rollbacks evaluate system telemetry after deployment and trigger recovery scripts automatically when alerts breach.