Courseiva
Design and implement source controlmediumMultiple ChoiceObjective-mapped

AZ-400 Design and implement source control Practice Question

A team uses a monorepo in Azure Repos. They want to implement a build validation policy that only triggers builds for code changes in specific folders to reduce build times. Which approach should they use?

⚠ Common exam trap

Candidates often confuse branch policy path filters with pipeline trigger path filters. Build validation policies are configured in Azure Repos branch policies and support path filters that apply specifically to pull request validations. Pipeline trigger path filters (in YAML) control when a pipeline runs on push CI, but they do not configure the build validation policy itself.

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 the build policy in Azure Repos with a path filter to limit which folders trigger the policy.

Azure Repos build validation policies allow you to specify path filters when configuring the policy. These path filters restrict when the policy requires a build, based on the files changed in the pull request. By setting the path filter to the specific folders of interest, the build validation only triggers for changes in those folders, directly reducing build times for unrelated changes. Pipeline trigger path filters (Option D) control CI builds on push, not the build validation policy for pull requests.

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 a manual trigger and have developers specify which folder to build.

    Why it's wrong here

    Using a manual trigger defeats the purpose of an automated build validation policy. It requires manual intervention and does not automatically trigger based on code changes. This is not efficient for continuous integration.

  • Create separate YAML pipelines for each folder and configure branch policies to require all pipelines.

    Why it's wrong here

    Creating separate YAML pipelines for each folder increases complexity and maintenance overhead. Branch policies would then need to require all pipelines, which could lead to unnecessary builds and doesn't leverage path filtering to reduce build times effectively.

  • Configure the build policy in Azure Repos with a path filter to limit which folders trigger the policy.

    Why this is correct

    Path filters in build validation policies affect only PR validation builds and do not control CI triggers. Additionally, the policy's path filter only determines whether the build is required for the PR; it does not prevent the pipeline from being triggered by other means. To limit builds to specific folders for all triggers, path filters should be configured in the pipeline trigger itself (as in option D).

  • Configure path filters in the pipeline trigger to include only the changed folder.

    Why it's wrong here

    Configuring path filters in the pipeline trigger using the `paths` keyword in the YAML pipeline file is the recommended approach. It allows you to specify include and exclude patterns so that the pipeline only triggers when changes are made to the specified folders, directly reducing unnecessary builds for any trigger type (push, PR, etc.).

Go deeper

Related to this question

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.