Courseiva
Design and implement a source control strategymediumMultiple ChoiceObjective-mapped

AZ-400 Practice Question: Design and implement a source control strategy

Your team uses a monorepo in Azure Repos containing multiple projects. You want to set up CI/CD so that only the projects affected by a commit are built and deployed. Which approach should you use?

⚠ Common exam trap

Candidates often pick a single pipeline with path triggers (option D) thinking it will run only affected projects, but path triggers only decide whether the whole pipeline starts; to limit execution within a single pipeline, you need additional conditions. Separate pipelines per project are a cleaner solution.

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

Create separate Azure Pipelines for each project, each configured to trigger on changes to that project's folder.

In a monorepo, to build and deploy only affected projects, create one Azure Pipeline per project and configure each with path-based triggers that include only that project's folder. This way, a commit touching a specific project triggers only that project's pipeline. While a single pipeline can use path filters and conditions to skip steps, the straightforward and recommended approach is separate pipelines.

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 Git hooks to detect changes and run only the relevant build scripts locally.

    Why it's wrong here

    Git hooks execute on a developer's local machine, not on the Azure Pipelines agent, so they can be bypassed (e.g., with --no-verify) and offer no server-side enforcement. For CI/CD, builds must run centrally and deterministically on every commit; relying on local hooks cannot guarantee that changes are built or that the pipeline reflects repository state.

  • Create separate Azure Pipelines for each project, each configured to trigger on changes to that project's folder.

    Why this is correct

    This can work but is harder to maintain than a single pipeline with path filters.

  • Use a single YAML pipeline that includes all projects, and use the 'condition' keyword to skip steps based on changed files.

    Why it's wrong here

    A single YAML pipeline with conditions on changed files still triggers the pipeline for every push to the branch, causing unnecessary pipeline runs, resource consumption, and potential queuing delays. The condition only skips steps after the pipeline has already started; path filters in the trigger section prevent the pipeline from running in the first place when unrelated folders change.

  • Use a single YAML pipeline with path-based triggers and path filters in the 'trigger' section for each project's folder.

    Why it's wrong here

    Configuring path filters under the trigger section (e.g., trigger: paths: include: ['projectA/**']) ensures Azure Pipelines only starts a run when files under the specified project folder are changed. This provides efficient, server-side filtering that avoids entire builds for unrelated monorepo changes, keeping the pipeline focused and minimizing wasted CI minutes.

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 →

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.