Courseiva
Configure processes and communicationsmediumMultiple ChoiceObjective-mapped

AZ-400 Configure processes and communications Practice Question

Exhibit

{
  "syntaxVersion": "1.0",
  "enforceAdmins": true,
  "branchProtection": [
    {
      "branch": "main",
      "requiredStatusChecks": ["continuous-integration/azure-pipelines"],
      "requiredApprovingReviewCount": 2,
      "dismissStaleReviews": true,
      "lockBranch": false
    }
  ]
}

Refer to the exhibit. You are migrating repository policies from Azure Repos to GitHub. The JSON shows a branch protection rule you plan to apply to the main branch. A developer pushes a hotfix directly to main without a pull request. What happens?

⚠ Common exam trap

Remember that 'Require a pull request before merging' is the only setting that restricts direct pushes. Status checks and enforceAdmins apply to pull requests, not direct pushes.

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

The push succeeds because no push restriction is defined.

The branch protection rule includes required status checks and lockBranch (set to false), but it does not require pull requests before merging. In GitHub, direct pushes to a branch are only blocked if 'Require a pull request before merging' is enabled. Since that is not present here, the developer can push directly to main without a pull request, and the push succeeds. Options A and B are incorrect because required status checks and enforceAdmins do not block direct pushes; they only affect pull request merges. Option D is incorrect because lockBranch set to false allows modifications.

Answer analysis

Option-by-option breakdown

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

  • The push is blocked because required status checks are not met.

    Why it's wrong here

    In Azure DevOps, required status checks are part of pull request branch policies and are evaluated only when a pull request is created or updated. A direct push does not create a PR, so status checks are never triggered and cannot block the push.

  • The push is blocked because enforceAdmins is true.

    Why it's wrong here

    The enforceAdmins setting simply removes the Admin user bypass for existing branch policies; it does not itself impose a push restriction. Because no push-related policy is defined here, enforceAdmins has no effect and the push is allowed by standard Git permissions.

  • The push succeeds because no push restriction is defined.

    Why this is correct

    The push succeeds because no branch policy restricts direct pushes to this branch, so only the repository's standard Git permissions apply. As long as the user has Contribute permission on the repository, a direct push to a non-locked branch is permitted.

  • The push is rejected because lockBranch is false.

    Why it's wrong here

    lockBranch: false explicitly means the branch is not locked, so this setting does not cause rejection. Branch locking is a separate Azure DevOps feature that prevents updates only when set to true; with false, there is no lock restriction.

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.