AZ-400 Path filter Practice Question
Exhibit
Refer to the exhibit.
```json
{
"triggers": [
{
"branch": "main",
"paths": {
"include": [
"/src/*"
]
}
}
],
"pool": {
"vmImage": "ubuntu-latest"
},
"steps": [
{
"script": "echo Building..."
}
]
}
```You have an Azure Pipelines YAML file with the following trigger configuration:
```yaml trigger: branches: include: - main paths: include: - /src/* ```
The team reports that the pipeline does not trigger when changes are pushed to the main branch that modify files outside the /src folder. What is the most likely reason?
⚠ Common exam trap
The trap is that candidates may overlook the path filter's restrictive behavior and instead focus on minor syntax details like 'branch' vs 'branches', missing that the core issue is the include pattern limiting triggers to only the /src folder. Without seeing the exhibit, it's essential to recognize that path filters are the most likely cause.
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 path filter restricts the trigger to only changes in /src/.
The most likely reason is that a path filter is configured in the trigger, restricting the pipeline to only trigger on changes under /src/. The other options are incorrect because they either refer to minor syntax issues or irrelevant details.
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 path filter restricts the trigger to only changes in /src/.
Why this is correct
The path filter in the trigger uses the 'paths' keyword with an 'include' clause, which restricts the pipeline to run only when changes are made to files under the /src/ directory. Any commits affecting other paths, such as the root or documentation, will not trigger the pipeline, making this statement correct.
- ✗
The trigger syntax is incorrect; 'branch' should be 'branches'.
Why it's wrong here
The trigger syntax is actually valid because 'branch' is a recognized shorthand for 'branches' in Azure Pipelines YAML. Both 'branch' and 'branches' are accepted, so this is not a syntax error; the pipeline would still parse and execute correctly.
- ✗
The script step is missing a display name.
Why it's wrong here
The 'displayName' property is optional for script steps in Azure Pipelines. If omitted, the system generates a default name based on the script content, so its absence does not cause a syntax or runtime error. Thus, this statement incorrectly identifies a missing display name as a problem.
- ✗
The pool vmImage is not specified correctly.
Why it's wrong here
The 'vmImage' property is correctly specified as a string value under the 'pool' section, using a valid Microsoft-hosted agent image. Azure Pipelines recognizes standard values like 'ubuntu-latest', and this syntax is correct, so the statement is false.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Azure Pipelines
Azure Pipelines is a cloud-based CI/CD service from Microsoft that automatically builds, tests, and deploys code to any platform or cloud.
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
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.