I'm currently migrating an existing CI/CD pipeline build in Azure DevOps from the ‘classic’ build approach to YAML files. Yesterday I talked about the concept of templates as a replacement for Task groups in the 'classic' pipeline.
I showed how to create a template and use it inside your YAML pipeline. What I didn’t mention is that next to ‘including’ a template it is also possible to ‘inherit’ from a template.
Let’s find out how to do this.
Extending a template
To ‘inherit’ from a template, we should let a pipeline extend from an extendible template.
To have an extendible template, it must be created on the level of the stages:
To create a pipeline that extends a template, we need to provide the relative path to the template file and also pass all (required) parameter: