AZ400-Q: Reusing pipeline steps with templates

Q: A team has 10 YAML pipelines that all need the same build/test steps. They want to define those steps once and reuse them without duplicating YAML. Which Azure Pipelines feature should they use?

  • A) A template file referenced with template: in the pipeline’s steps
  • B) Copy the steps into every pipeline
  • C) A GitHub Actions reusable workflow (not available in Azure Pipelines)
  • D) A classic release task group (only works in the classic UI)

Answer: A. Templates let you define reusable snippets (steps, jobs, or stages) in a separate YAML file and include them with template: path/to/template.yml, passing parameters when needed. This is the standard way to share pipeline logic across many pipelines and keep them DRY.

Why it helps

Pipeline templates are a core “pipeline artifacts & templates” objective — knowing how to share logic across pipelines is regularly tested.

pipeline-templates · pipeline-yaml · azure-pipelines