Share via


YAML schema reference for Azure Pipelines

The YAML schema reference for Azure Pipelines is a detailed reference for YAML pipelines that lists all supported YAML syntax and their available options.

To create a YAML pipeline, start with the pipeline definition. For more information about building YAML pipelines, see Customize your pipeline.

The YAML schema reference does not cover tasks. For more information about tasks, see the Azure Pipelines tasks index.

Definitions

pipeline
A pipeline is one or more jobs that describe a CI/CD process.

jobs
Specifies the jobs that make up the work of a pipeline.

jobs.job
A job is a collection of steps run by an agent or on a server.

jobs.job.container
Container resource name.

jobs.job.strategy
Execution strategy for this job.

pool
Which pool to use for a job of the pipeline.

pool.demands
Demands (for a private pool).

pr
Pull request trigger.

resources
Resources specifies builds, repositories, pipelines, and other resources used by the pipeline.

resources.builds
List of build resources referenced by the pipeline.

resources.builds.build
A build resource used to reference artifacts from a run.

resources.containers
List of container images.

resources.containers.container
A container resource used to reference a container image.

resources.pipelines
List of pipeline resources.

resources.pipelines.pipeline
A pipeline resource.

resources.repositories
List of repository resources.

resources.repositories.repository
A repository resource is used to reference an additional repository in your pipeline.

steps
Steps are a linear sequence of operations that make up a job.

steps.bash
Runs a script in Bash on Windows, macOS, and Linux.

steps.checkout
Configure how the pipeline checks out source code.

steps.download
Downloads artifacts associated with the current run or from another Azure Pipeline that is associated as a pipeline resource.

steps.downloadBuild
Downloads build artifacts.

steps.powershell
Runs a script using either Windows PowerShell (on Windows) or pwsh (Linux and macOS).

steps.publish
Publishes (uploads) a file or folder as a pipeline artifact that other jobs and pipelines can consume.

steps.pwsh
Runs a script in PowerShell Core on Windows, macOS, and Linux.

steps.script
Runs a script using cmd.exe on Windows and Bash on other platforms.

steps.task
Runs a task.

steps.template
Define a set of steps in one file and use it multiple times in another file.

trigger
Continuous integration (push) trigger.

variables
Define variables using name/value pairs.

variables.group
Reference variables from a variable group.

variables.name
Define variables using name and full syntax.

variables.template
Define variables in a template.

Supporting definitions

Note

Supporting definitions are not intended for use directly in a pipeline. Supporting definitions are used only as part of other definitions, and are included here for reference.

includeExcludeFilters
Lists of items to include or exclude.

workspace
Workspace options on the agent.

YAML schema documentation conventions

The YAML schema reference is a detailed reference guide to Azure Pipelines YAML pipelines. It includes a catalog of all supported YAML capabilities and the available options.

Here are the syntax conventions used in the YAML schema reference.

  • To the left of : is a literal keyword used in pipeline definitions.
  • To the right of : is a data type. The data type can be a primitive type like string or a reference to a rich structure defined elsewhere in this reference.
  • The notation [ datatype ] indicates an array of the mentioned definition type. For instance, [ string ] is an array of strings.
  • The notation { datatype : datatype } indicates a mapping of one data type to another. For instance, { string: string } is a mapping of strings to strings.
  • The symbol | indicates there are multiple data types available for the keyword. For instance, job | template means either a job definition or a template reference is allowed.

See also

This reference covers the schema of an Azure Pipelines YAML file. To learn the basics of YAML, see Learn YAML in Y Minutes. Azure Pipelines doesn't support all YAML features. Unsupported features include anchors, complex keys, and sets. Also, unlike standard YAML, Azure Pipelines depends on seeing stage, job, task, or a task shortcut like script as the first key in a mapping.