Courseiva

AZ-400 Practice Question: Design and implement build and release pipelines

Your organization uses GitHub Flow for source control with a monorepo containing multiple microservices. Each microservice has its own build and test workflow. You need to design a CI/CD strategy that builds and tests only the services affected by a pull request to reduce build times and resource usage. You also need to ensure that all pull requests to the main branch pass required checks before merging. What should you implement?

⚠ Common exam trap

AZ-400 often tests whether candidates confuse matrix strategies (which run all combinations) with path-filtered triggers (which conditionally skip workflows) — matrix parallelism is not the same as selective execution.

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

✓

Use separate workflows for each microservice with path filters (on: pull_request paths:) so that only workflows with changed files are triggered.

Path filters on the `on: pull_request` trigger allow each microservice workflow to run only when files under its directory change, which is the standard GitHub Actions pattern for monorepo selective CI. This directly reduces build time and resource consumption while still satisfying required status checks configured on the main branch. Separate workflows also give per-service check granularity, so branch protection rules can require only the relevant checks.

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 single workflow that builds and tests all microservices on every push to any branch.

    Why it's wrong here

    This approach triggers a full build and test of every microservice on every push to any branch, regardless of which code actually changed. That creates redundant CI runs for unrelated commits and intermediate pushes, wasting runner time and compute resources; it also lacks path filtering to scope work to affected services.

  • ✗

    Set up a webhook that triggers builds manually per service based on pull request comments.

    Why it's wrong here

    Relying on a human to type a pull request comment to kick off a webhook-based build is not true automation and does not provide reliable CI signal. GitHub cannot enforce branch protection or required status checks on comment-triggered webhooks, so the pipeline can be skipped entirely and does not gate the PR merge process consistently.

  • ✗

    Create a single workflow that uses a matrix strategy to build and test each microservice, and run it on every pull request.

    Why it's wrong here

    A matrix strategy does iterate over each microservice, but it still builds all of them on every pull request because the matrix is static unless you manually add diff-detection logic. Without conditional job execution based on changed paths, it consumes the same resources as a single large pipeline and does not take advantage of GitHub Actions' native path filters.

  • ✓

    Use separate workflows for each microservice with path filters (on: pull_request paths:) so that only workflows with changed files are triggered.

    Why this is correct

    Creating separate workflow files per microservice and using `on: pull_request: paths:` means each workflow activates only when a push or PR changes files under its configured path. This scopes builds and tests to the specific services affected by a change, reducing CI runtime and cost while still producing required status checks for the PR.

About these practice questions

Courseiva writes every AZ-400 question from scratch — 696 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

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.