extends definition

Extend a pipeline using a template.

extends:
  template: string # The template referenced by the pipeline to extend.
  parameters: # Parameters used in the extend.

Definitions that reference this definition: pipeline

Properties

template string.
The template referenced by the pipeline to extend.

parameters template parameters.
Parameters used in the extend.

Examples

Templates and their parameters are turned into constants before the pipeline runs. Template parameters provide type safety to input parameters. In this example, templates restrict which pools can be used in a pipeline by offering an enumeration of possible options rather than a freeform string.

# template.yml
parameters:
- name: userpool
  type: string
  default: Azure Pipelines
  values:
  - Azure Pipelines
  - private-pool-1
  - private-pool-2

pool: ${{ parameters.userpool }}
steps:
- script: # ... removed for clarity
# azure-pipelines.yml
extends:
  template: template.yml
  parameters:
    userpool: private-pool-1

See also