AZ-400 Configure processes and communications Practice Question
Your team uses GitFlow and wants to enforce that all feature branches are deleted after merging to develop. Which automation should you implement?
⚠ Common exam trap
A common mix-up: candidates confuse branch retention policies (which are time-based cleanup rules) with the immediate deletion policy on PR completion, or assume a pipeline script is necessary when a built-in repository policy already exists.
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
✓
Enable the 'Automatically delete source branches' policy in the branch policy.
The 'Automatically delete source branches' policy in Azure Repos branch policies automatically removes a feature branch once its pull request is completed into the target branch (e.g., develop). This directly enforces the GitFlow requirement without manual intervention or pipeline scripting, as it is a native repository-level setting.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Enable the 'Automatically delete source branches' policy in the branch policy.
Why this is correct
Enabling 'Automatically delete source branches' in the branch policy for the target branch (e.g., main or develop) ensures that whenever a pull request is merged, the source feature branch is deleted automatically. This is a native Azure Repos policy that enforces cleanup without relying on developer action or custom scripts, making it the correct way to enforce branch cleanup in GitFlow.
- ✗
Use a post-merge script in the pipeline.
Why it's wrong here
A post-merge script in the pipeline depends on the pipeline running successfully after every merge, which is not guaranteed for all merges—especially if a merge bypasses the pipeline or the pipeline fails. This approach is not a native enforcement mechanism and requires custom setup and maintenance, making it less reliable and not the intended solution for automatic branch deletion.
- ✗
Train developers to delete branches manually.
Why it's wrong here
Training developers to delete branches manually is ineffective for enforcement because it relies on individual compliance and is prone to being forgotten or done incorrectly. Manual deletion does not provide any automated guarantee that all feature branches are cleaned up after merge, so it cannot enforce the desired GitFlow process consistently.
- ✗
Configure branch retention policies in Azure Repos.
Why it's wrong here
Branch retention policies in Azure Repos apply to pipeline runs, not to Git branches. They control how long build or release pipeline runs are retained, and they have no effect on source branch deletion after a pull request merge, so this option does not address the requirement at all.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Gitflow
Gitflow is a branching model for Git that defines a structured set of branch types and workflows to manage feature development, releases, and hotfixes in software projects.
Key term
Pull request
A pull request is a way for a developer to propose changes to a codebase and ask other team members to review and merge them into the main project.
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 →
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.