Bitzu

AZ-400 ยท Reusable pipelines and approvals

Includes vs extends templates

Step, job, stage and variable templates, template parameters, extends templates and required templates, GitHub reusable workflows and composite actions, task groups in classic pipelines.

Key points

  • includes template: pastes steps, jobs, stages or variables into the referencing file (like #include).
  • extends template: owns the outer structure and exposes parameters (for example a stepList) as the only customization points, so it can enforce security rules.
  • Required template check: forces pipelines through it.
  • GitHub: reusable workflows (on: workflow_call, job-level uses) and composite actions (reusable step bundles).

Source: https://learn.microsoft.com/en-us/azure/devops/pipelines/security/templates?view=azure-devops

Practice questions

Single choice

Which Azure Pipelines template type defines the outer structure of a pipeline and exposes only chosen customization points to the pipeline that uses it?

  1. An includes template
  2. An extends template
  3. A variable group
  4. A task group
Show answer

Answer: B. An extends template

An extends template acts like inheritance: it owns the structure. An includes template merely inserts content inline, so the consuming file stays in control.

Select all that apply

Which statements about GitHub Actions reusable workflows are correct?

  1. The called workflow declares on: workflow_call
  2. The caller invokes it with uses at the job level
  3. The caller invokes it with uses inside a step
  4. The file can live in any subfolder of .github/workflows
  5. Secrets automatically flow through a whole chain of nested calls
Show answer

Answer: A. The called workflow declares on: workflow_call, B. The caller invokes it with uses at the job level

A reusable workflow is triggered by workflow_call and is invoked with uses on a job, not on a step. Files must sit directly in .github/workflows (subfolders are not supported), and secrets are not forwarded down a chain automatically.

True or false

True or false: a required template check also passes pipelines that do not use extends at all, because it only validates templates that are actually referenced.

Show answer

Answer: False

False. When the check is in place, a pipeline that does not extend from the required template fails the check. That is exactly what makes it an enforcement tool.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More AZ-400 topics in this module