Courseiva
Design and implement build and release pipelineshardMultiple SelectObjective-mapped

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

Your organization uses GitHub Actions for CI/CD. You need to enforce branch protection rules and ensure that all pull requests to the main branch require a successful status check from a specific workflow. Which TWO actions should you take? (Choose two.)

⚠ Common exam trap

A common mix-up: candidates confuse GitHub's branch protection rules with repository rulesets or Azure Repos policies, leading candidates to select options that are either for a different platform or for a different enforcement mechanism.

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

Add a workflow to the repository that runs tests and reports a conclusion status.

A workflow that runs tests and reports a conclusion status provides the status check that branch protection rules can require. Option E is correct because enabling 'Require status checks to pass before merging' under branch protection rules in the repository settings enforces that the specific workflow's status check must succeed before a pull request can be merged into the main branch.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Configure a GitHub environment with required reviewers.

    Why it's wrong here

    Configuring a GitHub environment with required reviewers gates deployments to that environment, not pull request merges. It is a deployment protection rule that affects workflow jobs referencing the environment, but it does not enforce that tests pass before code is merged into the main branch.

  • Add a workflow to the repository that runs tests and reports a conclusion status.

    Why this is correct

    Adding a workflow that runs tests and reports a conclusion status is the essential first step because it creates a check run (status check) whose conclusion can later be required. Without such a workflow, there is no status check for branch protection rules to enforce, so this is the correct way to enable test validation before merging.

  • Use a repository ruleset to require status checks.

    Why it's wrong here

    Repository rulesets are a feature in GitHub that allow you to define rules for branches and tags, but they are not the direct mechanism used to require status checks before merging a pull request. The Azure-required workflow is to configure branch protection rules under Repository Settings > Branches, where the 'Require status checks to pass before merging' option consumes the check conclusion produced by your GitHub Actions workflow. While a ruleset could enforce similar controls, it is a newer, broader policy layer and is not the standard branch-protection configuration referenced by AZ-400 or the GitHub UI when requiring CI checks for the main branch.

  • Set up branch policies in Azure Repos for the main branch.

    Why it's wrong here

    Branch policies in Azure Repos apply only to repositories hosted in Azure DevOps, not to GitHub repositories. Since the organization uses GitHub Actions, Azure Repos policies are irrelevant and cannot protect the main branch in GitHub, making this option incorrect.

  • In the repository settings, enable 'Require status checks to pass before merging' under branch protection rules.

    Why this is correct

    Enabling 'Require status checks to pass before merging' under branch protection rules is the GitHub-native enforcement mechanism that blocks pull requests from merging until the workflow's conclusion is successful. This directly uses the status check produced by the workflow, making it an essential and correct step to enforce the required test validation.

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.