YAML pipeline

What it is

A YAML pipeline is an Azure Pipelines definition written in a YAML file stored with source code, commonly azure-pipelines.yml. It is “pipeline as code”: the automation instructions can be versioned, reviewed, and changed through the same workflow as the application.

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

  • Common top-level keys include trigger, pr, pool, variables, stages, jobs, steps, extends, and resources. A pipeline does not need every key.
  • Execution is hierarchical: stages contain jobs, and jobs contain steps. This makes it possible to model build, test, and deployment work separately.
  • Templates reduce repetition. template: and extends can share approved pipeline logic, but they also create dependencies that must be reviewed and versioned carefully.
  • YAML lives in the repo. You can edit it in the Azure Pipelines experience or in any editor, then use a PR to review what the automation will do.
  • GitHub Actions also uses YAML under .github/workflows/, but its syntax and execution model are not interchangeable with Azure Pipelines YAML.

Northwind example

Northwind keeps azure-pipelines.yml beside the order API. The file triggers CI for main, defines a build stage, a test stage, and a production deployment stage, and imports a shared security-scan template. When Luis changes the pipeline, the PR shows both the application change and the exact automation change reviewers must assess.

Exam notes

  • A YAML pipeline is versioned automation, not a static configuration screen.
  • Learn the stage → job → step structure and the trigger, pool, variables, and template concepts.
  • Review pipeline changes as carefully as application changes because they can build, access, and deploy systems.

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

📘 Source: Microsoft Learn — Pipeline Yaml