YAML pipeline

What it is

A YAML pipeline is an Azure Pipelines definition written as a azure-pipelines.yml file in your repository — pipelines as code. It replaces the older classic (visual designer) editor and is the recommended way to define CI/CD.

Why it exists

Storing the pipeline in the repo means it is versioned, reviewable in PRs, and created/maintained like application code. Configuration lives beside the source it builds.

Key ideas

  • Top-level keys: trigger, pr, pool, variables, stages, jobs, steps, extends, resources.
  • Execution model: stages → jobs → steps (see jobs-steps).
  • Schema version 2 (YAML) is current; name, resources (repos, containers, pipelines).
  • Templates let you reuse YAML via template: / extends (see pipeline-templates).
  • Edited in Azure DevOps “Pipelines” UI or directly in the repo.
  • GitHub Actions workflows are also YAML (.github/workflows/*.yml) but use a different schema (on: events, runs-on:).

Exam notes

  • Conventional filename is azure-pipelines.yml.
  • YAML-first is the recommended approach; classic editor is legacy.
  • Common exam tasks: write a trigger:, set a pool:, add steps, reference variables and templates.
  • Validate YAML in the pipeline UI; syntax errors fail the run at queue time.

azure-pipelines · jobs-steps · ci-trigger · pipeline-templates

📘 Source: Microsoft Learn — Pipeline Yaml