Courseiva
Design and implement a source control strategyeasyMultiple ChoiceObjective-mapped

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

Your team uses Git and wants to ensure that all commits follow a consistent message format. Which approach should you use?

⚠ Common exam trap

Watch out — candidates often assume server-side enforcement (branch policies or pipeline validation) is the only way to enforce commit message standards, overlooking the fact that client-side hooks provide immediate, local validation before the commit is ever recorded.

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 a client-side Git hook (commit-msg) to validate the message

A client-side Git hook, specifically the commit-msg hook, runs locally on the developer's machine before the commit is finalized, allowing immediate validation of the commit message format. This ensures that every commit adheres to the team's convention at the point of creation, without relying on server-side enforcement or pipeline execution.

Answer analysis

Option-by-option breakdown

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

  • Add a step in Azure Pipelines to validate commit messages

    Why it's wrong here

    A pipeline validation step runs only after a commit is pushed to the remote repository, so it cannot prevent invalid commit messages from being created locally. Since the commit history is already immutable at that point, any discovered violations would require a history rewrite to correct.

  • Use a client-side Git hook (commit-msg) to validate the message

    Why this is correct

    A client-side commit-msg hook executes on the developer's machine before the commit is finalized, allowing the message to be validated against a pattern and abort the commit if it does not conform. This is the only mechanism that prevents an invalid commit from ever existing in the local repository.

  • Create a GitHub Actions workflow that checks commit messages on push

    Why it's wrong here

    A GitHub Actions workflow triggered on push is executed after the commits have already been uploaded to the remote repository, so it cannot act as a pre-commit gate. Invalid messages are already part of the permanent history by the time the workflow runs, and remediation requires force-pushing or rebasing.

  • Configure a branch policy in Azure Repos to enforce commit message format

    Why it's wrong here

    Azure Repos branch policies support status checks, builds, work item linking, and reviewer requirements, but they do not include a native rule to validate commit message text or format. Therefore, this option is not technically available in Azure Repos without additional custom tooling or extensions.

About these practice questions

Courseiva writes every AZ-400 question from scratch — 823 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 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.