nerdexam
Microsoft

AZ-400 · Question #362

You have a project in Azure DevOps. You create the following YAML template named Template1.yml. steps: - script: npm install - script: yarn install - script: npm run compile You create the following p

The correct answer is C. extends: template: templatel.yml parameters: usersteps:. Azure Pipelines offers two kinds of templates: includes and extends. Included templates behave like #include in C++: it's as if you paste the template's code right into the outer file, which template provides the outer structure of the pipeline and a set of places where the templ

Submitted by luis.pe· Mar 6, 2026Design and implement build and release pipelines

Question

You have a project in Azure DevOps. You create the following YAML template named Template1.yml. steps: - script: npm install - script: yarn install - script: npm run compile You create the following pipeline named File1.yml. parameters: usersteps: - task: MyTask@1 - script: echo Done You need to ensure that Template1.yaml runs before File1.yml. How should you update File1.yml?

Options

  • Aparameters: usersteps: extends: template: template1.yml
  • Btemplate: template1.yml parameters: usersteps:
  • Cextends: template: templatel.yml parameters: usersteps:
  • Dparameters: usersteps: - template: templatel.yml

How the community answered

(50 responses)
  • A
    4% (2)
  • B
    6% (3)
  • C
    76% (38)
  • D
    14% (7)

Explanation

Azure Pipelines offers two kinds of templates: includes and extends. Included templates behave like #include in C++: it's as if you paste the template's code right into the outer file, which template provides the outer structure of the pipeline and a set of places where the template consumer can make targeted alterations. template: template.yml@templates - script: echo This is my first step - script: echo This is my second step https://docs.microsoft.com/en-us/azure/devops/pipelines/security/templates

Community Discussion

No community discussion yet for this question.

Full AZ-400 Practice