AZ-400 Practice Question: Design and implement a source control strategy
Your team uses Azure Pipelines to build and test code. You want to automatically trigger a pipeline when a pull request is created targeting the main branch. Which trigger should you configure?
⚠ Common exam trap
It's easy for candidates to confuse CI triggers with PR triggers, assuming a CI trigger on the target branch will run for PRs, but CI triggers only fire on direct pushes, not on PR creation events.
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
✓
PR trigger
A PR trigger is the correct choice because Azure Pipelines supports a 'pr' trigger that automatically starts a pipeline when a pull request is created targeting a specified branch (e.g., main). This is distinct from a CI trigger, which runs on commits to a branch, and is essential for validating changes before merging.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
PR trigger
Why this is correct
PR trigger is the correct answer because Azure Pipelines automatically runs a pipeline when a pull request is created or updated in a branch, allowing validation of proposed changes before merge. It is ideal for verifying code in a feature branch that is the source of a pull request, ensuring the target branch remains stable.
- ✗
Scheduled trigger
Why it's wrong here
Scheduled trigger is incorrect because it runs the pipeline at predefined times (e.g., nightly) regardless of any code changes or pull requests. It is not designed to react to pull request events, so it would not validate commits pushed to a PR branch at the moment they are made.
- ✗
CI trigger
Why it's wrong here
CI trigger is incorrect because it runs on pushes to branches or tags, not on pull requests. While a CI trigger can be configured to build the source branch of a PR, it fires on the push event itself, not on the explicit creation or update of a pull request, and does not inherently wait for PR status checks.
- ✗
Manual trigger
Why it's wrong here
Manual trigger is incorrect because it requires a user to explicitly start the pipeline via the Azure DevOps UI, REST API, or Azure CLI. It provides no automatic reaction to pull request creation or updates, so it would not fulfill the requirement of automatically building and testing code when a PR is opened.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Branch
A branch is a pointer to a specific commit in a version control system that allows you to work on features or fixes in isolation from the main codebase.
Key term
Azure Pipelines
Azure Pipelines is a cloud-based CI/CD service from Microsoft that automatically builds, tests, and deploys code to any platform or cloud.
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 →
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.