Advanced YAML pipelines

MS Learn module: Advanced Azure Pipelines YAML · Learning objectives: read and write the full YAML schema and keywords, control queue/runtime behavior, and factor reusable snippets so a change lands once.

Overview

The advanced YAML module is where a pipeline author moves from “it runs” to “it runs well and stays maintainable.” It covers the official YAML schema and its keywords, the runtime knobs (queues, parallelism, scope links), and the reusability machinery — template:/extends: and GitHub Actions reusable workflows — that keep large YAML from becoming copy-paste sprawl.

Units / lessons covered

  • Full pipeline YAML schema: top-level keys (trigger, jobs, steps, pool, variables, notifications, extensions)
  • Schema keywords for jobs/steps: run, type, supportsCancellation, continueOnError, timeoutInMinutes
  • Queues and runtime: how jobs queue for agents, pool capacity, retry/back-off (see pipeline-run)
  • Reusable snippets: Azure templates: include + extends; GitHub composite actions and reusable workflows (on: workflow_call)
  • Expressions and typed parameters: ${{ variables }}, defaults, type: string/branch guard

Key terms / commands

  • trigger: · jobs: · steps: · pool: · with: · template: extends · extends:
  • GitHub equivalent: workflow_call · ./.github/workflows/reusable.yml · with: input params

Hands-on / what to try

Refactor a 200-line pipeline by extracting the repeated build-and-cache step into a templates/build-cache.yml snippet included from two jobs; then convert one GitHub workflow to a reusable composite and call it from a second.

Exam focus

  • Know the top-level schema keys and the difference between template: (include) vs extends: (structural inheritance).
  • Parameters get defaults + types; secrets are never passed by value into templates by hand.
  • Queues/limits and retry semantics differ between Azure-hosted and self-hosted pools.

Path MOC · pipeline-components-and-stage · pipeline-artifacts-and-templates · set-up-ci-with-azure-pipelines

📘 Source: Azure Pipelines YAML schema reference · YAML expressions