Triggering Separate Frontend and Backend Pipelines from One Monorepo
Your team uses GitHub with a monorepo containing frontend and backend code. You need to implement a strategy where changes to the frontend folder trigger a frontend CI pipeline, changes to the backend folder trigger a backend CI pipeline, and changes to both trigger both. You also want to ensure that pull requests include changes only to one area to reduce complexity. What should you do?
Quick Answer
Separate CI pipelines with path filters on their triggers is what makes each folder's changes drive its own pipeline: a frontend-scoped filter only fires the frontend pipeline, a backend-scoped filter only fires the backend one, and a PR touching both folders naturally triggers both — no manual routing logic required.
⚠ Common exam trap
Watch out — candidates often think branch policies or CODEOWNERS can control pipeline triggers, but only path filters in the pipeline YAML definition can conditionally start a pipeline based on which files changed.
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
✓
Configure separate CI pipelines with path filters so that each pipeline triggers only on changes to its respective folder.
GitHub Actions and Azure Pipelines support path filters (e.g., `paths` in YAML triggers) that allow you to define separate CI pipelines for frontend and backend folders. When a pull request includes changes to both folders, both pipelines automatically trigger, satisfying the requirement. This approach ensures that each pipeline runs only when its relevant code changes, reducing unnecessary builds and complexity.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use CODEOWNERS to assign different reviewers for frontend and backend, and rely on manual pipeline triggers.
Why it's wrong here
CODEOWNERS does not trigger pipelines.
- ✓
Configure separate CI pipelines with path filters so that each pipeline triggers only on changes to its respective folder.
Why this is correct
Path filters allow conditional triggering.
- ✗
Create branch policies that require specific builds based on the branch name.
Why it's wrong here
Branch policies cannot detect changed paths.
- ✗
Use a single pipeline that runs all tests on every change.
Why it's wrong here
Inefficient and does not separate concerns.
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 →
Same concept, more angles
1 more way this is tested on AZ-400
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. Your team uses GitHub and wants to automatically label pull requests based on the content of the changes (e.g., 'frontend' for changes in /frontend folder, 'backend' for /backend). Which approach should you use?
hard- A.Use branch protection rules to require specific labels based on branch name patterns.
- B.Set up a webhook that triggers an Azure Function to parse the pull request diff and add labels.
- ✓ C.Create a GitHub Actions workflow that runs on pull_request events and uses an action like 'actions/labeler' to add labels based on path patterns.
- D.Use a CODEOWNERS file to assign labels based on file paths.
Why C: GitHub Actions provides a native, event-driven way to automate labeling based on pull request changes. The 'actions/labeler' action specifically inspects file paths in the diff and applies labels defined in a configuration file, making it the simplest and most maintainable solution for path-based labeling.
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.