AZ-400 Practice Question: Design and implement build and release pipelines
Exhibit
Refer to the exhibit.
```json
{
"resources": {
"repositories": [
{
"repository": "shared-templates",
"type": "git",
"name": "myorg/shared-templates",
"ref": "refs/heads/main"
}
]
},
"jobs": [
{
"job": "build",
"steps": [
{
"checkout": "self"
},
{
"checkout": "shared-templates"
},
{
"template": "shared-templates/build-steps.yml",
"parameters": {
"buildConfiguration": "Release"
}
}
]
}
]
}
```You have the YAML pipeline exhibit above. The pipeline fails with: 'The pipeline is not valid. Could not find the template file shared-templates/build-steps.yml.' What is the most likely cause?
⚠ Common exam trap
Test-takers frequently assume the template path must include the repository name or folder structure, when in fact the path is relative to the root of the repository specified in the `repository` field, leading to a common mistake of over-specifying the path.
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
✓
The template path is incorrect because it should be relative to the repository root; the repository name is 'myorg/shared-templates', so the path should be 'build-steps.yml'.
When referencing a template from another repository in Azure Pipelines, the `repository` property specifies the repository name (e.g., `myorg/shared-templates`), and the template path must be relative to the root of that repository. The error indicates the pipeline cannot find the file, meaning the path `shared-templates/build-steps.yml` is incorrect; it should be just `build-steps.yml` since the repository name is already declared in the `repository` field. The path should not include the repository name again.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The checkout step for 'shared-templates' must be before the template reference, which it is.
Why it's wrong here
Template resolution occurs during pipeline compile time, before any steps execute, so the runtime order of checkout steps is irrelevant to whether the template can be found. Even with a prior checkout, the template path is still evaluated against the repository's root, not the working directory after checkout.
- ✗
The template file is missing from the shared-templates repository.
Why it's wrong here
The error message 'could not find' is ambiguous: it can mean the file does not exist, but in this scenario the template file likely exists at the repository root. The real issue is that the path 'shared-templates/build-steps.yml' incorrectly assumes the repository name is a subfolder, whereas the path must be relative to the repository root.
- ✓
The template path is incorrect because it should be relative to the repository root; the repository name is 'myorg/shared-templates', so the path should be 'build-steps.yml'.
Why this is correct
The path 'shared-templates/build-steps.yml' suggests that the template is in a subfolder, but the repository root is already 'shared-templates'.
- ✗
The ref 'refs/heads/main' does not exist in the shared-templates repository.
Why it's wrong here
If the ref 'refs/heads/main' did not exist in the shared-templates repository, Azure DevOps would return a distinct error such as 'The ref refs/heads/main could not be found' during template resolution. Since the reported error is specifically about the template file path, the ref itself is valid and not the cause of the failure.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Repository
A repository is a central storage location where software packages, code, or configuration files are kept, managed, and distributed for use by IT systems.
Key term
find
The find command in Unix/Linux is a powerful utility for searching files and directories based on a wide range of criteria such as name, size, type, permissions, and modification time.
About these practice questions
One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
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.