AZ-400 Practice Question: Design and implement build and release pipelines
You have a multi-stage YAML pipeline that builds and deploys a Node.js application. You want to ensure that the build stage runs only when changes are made to the 'src' folder. Which trigger configuration should you use?
⚠ Common exam trap
Watch out — candidates often confuse path filters with branch filters or batch settings, mistakenly thinking that branch filters or batching can restrict triggers to specific folders, when in fact only path filters provide that capability.
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
✓
Trigger with 'paths' filter
Azure Pipelines supports path-based triggers that allow you to specify which file paths should trigger a pipeline run. By configuring a trigger with a 'paths' filter that includes only the 'src' folder, the build stage will only execute when changes are detected within that specific directory, ignoring changes elsewhere in the repository.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Trigger with 'batch' set to true
Why it's wrong here
Setting 'batch' to true only coalesces multiple pending CI runs into a single run when the pipeline is already queued; it does not restrict which file changes or folders initiate the pipeline. Because it still triggers on any change per the default path scope, it cannot limit builds to a specific folder.
- ✗
Trigger with 'branches' filter
Why it's wrong here
A 'branches' filter limits triggers to commits on specific branches (e.g., main or releases/*), but it does not evaluate which files or directories changed. Since the goal is to build only when files in a particular folder change, a branches filter would still trigger on any change in the repo on that branch.
- ✓
Trigger with 'paths' filter
Why this is correct
Using a 'paths' filter in the CI trigger allows you to specify include or exclude patterns for file paths, so the pipeline only triggers when changes under the target folder (e.g., /frontend) are detected. This is the exact mechanism to scope triggers to a specific folder or set of files, making it the correct solution.
- ✗
Disable CI trigger and use a scheduled trigger
Why it's wrong here
A scheduled trigger only starts the pipeline at predefined times (e.g., nightly), independent of any code changes. It will not run immediately when a change is pushed to the specified folder, so it fails to meet the requirement of building only on those changes.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Stage
A stage is a discrete phase in a software development or deployment pipeline where code is built, tested, integrated, or released in a controlled environment.
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.
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.