CertLumen

Microsoft DevOps Engineer Expert (AZ-400) · Section 2 · 13% of the exam

Design and implement a pull request workflow by using branch policies and branch protection rules

One of the objectives of the Exam AZ-400: Designing and Implementing Microsoft DevOps Solutions exam, in the section “Design and implement a source control strategy”. Here is what it covers, the points to remember and a question to try.

What it covers

A branch strategy decides how code flows from a developer's laptop to production. This lesson compares trunk-based development, feature branches and release branches, then shows how branch policies in Azure Repos and branch protection rules or rulesets in GitHub enforce pull requests, reviews, checks and allowed merge types.

Points to remember

  • Trunk-based: short-lived branches, feature flags, deploy from main; feature branch: one branch per change merged by PR; release branch: release/* for supported versions.
  • Release branches are not merged back by PR; fix in main and cherry-pick into release (Release Flow), or fix in release and cherry-pick to main.
  • A required Azure Repos branch policy blocks direct pushes and branch deletion; changes go through PRs.
  • Minimum-reviewers options: creator vote, most recent pusher, reset votes on new pushes, completion despite wait or reject votes.
  • Build validation expiration choices: Immediately, After n hours, Never; path filters must start with / or a wildcard.

Try a question

A GitHub branch protection rule requires status checks. A developer's pull request passed all checks last week, but main has changed since. The team wants GitHub to block the merge until the branch is updated and tested against the latest main. Which option should be enabled?

  1. ARequire conversation resolution before merging
  2. BRequire signed commits on every review comment before the pull request can merge
  3. CRequire branches to be up to date before merging
  4. DAllow force pushes for every commit on the pull request branch
Show the answer

C. Under Require status checks to pass, the option Require branches to be up to date before merging (strict mode) forces the head branch to contain the latest base commit and be re-tested before merging.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Branch strategies, pull request workflows and merge restrictions teaches this objective (about 45 minutes), and 15 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 86 objectives · Next objective →