Microsoft AZ-400: CI/CD Pipelines with Azure Pipelines — Study Guide

Part of the Microsoft DevOps Engineer Expert AZ-400 — Study Guide. Practice with verified answers in the Microsoft exam hub, or take timed practice tests on ExamRoll.io.

Overview

Azure Pipelines delivers end-to-end CI/CD as code, with multi-stage YAML pipelines that unify build, test, and release while preserving enterprise controls. Mastery of YAML authoring, triggers, agents, variables, templates, deployment jobs, artifacts, caching, and service connections is essential to build scalable, secure, and repeatable delivery systems.

Authoring with YAML and Templates

A YAML pipeline is composed of stages, jobs, and steps. Stages model lifecycle boundaries such as Build, Test, Release; jobs execute on agents and can run in parallel; steps are tasks or scripts executed within a job. Dependencies are explicit via dependsOn, allowing fine-grained orchestration and conditional execution. Multi-stage YAML consolidates CI and CD, supports fan-in/fan-out patterns, and ties approvals to environments rather than a standalone release construct.

Templates enable composition and reuse at different granularities:

Template evaluation occurs at compile-time prior to runtime execution. Use ${{ }} for template expressions to branch the pipeline structure at compile time (for example, include certain jobs only for main). Macro syntax $(var) and runtime expressions $[ ] resolve at runtime, which affects when secrets and variable groups are available. Store shared templates in a central repo and import via resources repositories; pin to a branch or tag for deterministic builds.

Triggers, Agents, Variables, and Expressions

Triggers govern automation entry points:

Agents and agent pools determine where jobs run:

Variables and parameters drive configurability:

Deployments, Environments, Strategies, and Gates

Deployment jobs provide first-class CD semantics. A deployment job targets an environment and runs under a strategy that controls rollouts and lifecycle hooks:

Encode deployment logic as a deployment job per environment stage. Leverage environment checks for robust gates, not ad-hoc script polling. When secrets are needed, retrieve them from Azure Key Vault via a service connection rather than embedding them in variables.

Artifacts, Caching, and Service Connections

Artifacts and caching improve reuse and performance:

Service connections define the identity Azure Pipelines uses to reach external systems:

Classic vs YAML and Migration

Classic pipelines use the visual designer with separate Build and Release concepts. They offer task-based authoring, variable management, release environments, and gates. YAML pipelines provide pipeline-as-code, multi-stage unification, templates, and robust versioning with the repository. Feature parity is largely achieved: environment approvals and checks replace release gates; deployment jobs model environments; pipeline artifacts supersede build artifacts; and templates and extends implement central governance at scale. Remaining differences are typically around UI-based manual interventions and some niche release designer features, which are covered in YAML via Manual Validation tasks and environment checks.

A pragmatic migration path is:

  1. Inventory classic build and release definitions, tasks, variables, environments, approvals, and gates.
  2. Convert build to YAML using the assistant or export to YAML, then refactor into templates for reuse and maintainability.
  3. Model each release environment as a YAML stage with a deployment job targeting an environment. Translate release gates to environment approvals and checks (e.g., Azure Monitor query checks, work item query checks).
  4. Externalize shared variables into variable groups and link Key Vault for secrets. Replace service principal secrets with OIDC-backed service connections.
  5. Replace release artifact triggers with pipeline resource triggers. Publish pipeline artifacts in CI and consume them in CD stages.
  6. Validate parity by running both pipelines temporarily, then cut over and retire classic definitions with appropriate rollback plans.

Practical Problem Scenario

Starbucks is standardizing delivery for a microservices platform and must migrate from classic releases to YAML while enforcing performance gates, reducing credential risk, and speeding builds.

  1. Author multi-stage YAML with extends templates
  1. Implement CI, PR, schedule, and pipeline triggers
  1. Use mixed agent strategy with agent pools
  1. Manage variables with variable groups and runtime parameters
  1. Define deployment jobs with environments, approvals, and checks
  1. Apply canary then blue-green strategies
  1. Optimize with pipeline artifacts and caching
  1. Secure service connections with OIDC and scoped permissions

This end-to-end design aligns YAML-as-code governance with enterprise-grade approvals and checks, accelerates delivery through caching and artifacts, and strengthens security via OIDC and scoped service connections.


Source Control and Repository Management · All domains · Infrastructure as Code and Configuration Management

Practice these questions → · Timed practice on ExamRoll.io →

Pass the whole exam — not just this question

You found this answer. Get every verified question and explanation in one place, and save hours of prep. Free to start.

Pass your exam →

Browse Microsoft →

Related guides

All-in-one access

One subscription. Every exam.

Every plan unlocks unlimited answer search, practice tests, AI explanations, and the full resource library — in 20+ languages.

Monthly
24.87
Just €0.83/day
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

Best value
12 months
179.87
Just €0.49/daySave 40%
Everything included:
  • Unlimited answer search
  • Unlimited practice tests
  • AI-powered explanations
  • Full resource library
  • 20+ languages
  • Weekly content updates
  • Rewards & referrals
  • Priority support
Start free trial

No credit card required*

✓ Free plan included · ✓ Cancel anytime · ✓ All plans unlock the full product