Courseiva
Design and implement build and release pipelinesmediumMultiple SelectObjective-mapped

AZ-400 Practice Question: Design and implement build and release pipelines

Which TWO are true about Azure Pipelines YAML templates? (Choose two.)

⚠ Common exam trap

Watch out — candidates often confuse compile-time evaluation with runtime evaluation, leading them to think template expressions can use runtime variables, or they mistakenly believe templates must be in the same repo or require parameters, when in fact templates are flexible and optional in their structure.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Template expressions are evaluated at compile time.

Template expressions in Azure Pipelines YAML are evaluated at compile time, before the pipeline runs. This allows the template to inject variables, conditions, and other logic into the pipeline definition statically, ensuring that the final pipeline structure is fully resolved before execution begins.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Templates must be stored in the same repository as the main pipeline.

    Why it's wrong here

    Templates can reference files in other repositories using the 'repository' keyword in the template reference, allowing reuse across projects or teams. For example, '- template: common/build.yml@templates' pulls from a separate repo, so same-repo storage is not a requirement.

  • Template expressions are evaluated at compile time.

    Why this is correct

    Expressions like '${{ variables.var }}' are expanded when the pipeline is compiled, before any runtime execution. This enables conditional inclusion of stages, jobs, or steps based on parameters or compile-time variables, but they cannot reference runtime values like agent-specific variables.

  • Templates require parameters to be defined.

    Why it's wrong here

    Parameters are optional; a template can contain no 'parameters' section and simply define a reusable set of steps, jobs, or stages. When parameters are present, they must have default values or be supplied by the calling pipeline, but defining them is not mandatory.

  • Templates can be nested by including other templates.

    Why this is correct

    Templates can include other templates via the 'template' keyword, enabling modular composition and reuse of smaller building blocks. This nesting allows a top-level template to orchestrate multiple child templates, each handling a specific concern like build steps or deployment jobs.

  • Templates can only define a single job.

    Why it's wrong here

    A template's content depends on where it is used: step templates define steps, job templates define one or more jobs, and stage templates define one or more stages. This flexibility allows complex multi-job or multi-stage pipelines to be fully expressed in a template.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

This AZ-400 question is part of Courseiva's 823-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.