Courseiva
hardMultiple SelectObjective-mapped

AZ-400 Practice Question: Which TWO of the following are valid ways to…

Which TWO of the following are valid ways to trigger a pipeline in Azure DevOps when a pull request is created?

⚠ Common exam trap

A common mix-up: candidates confuse the continuous integration trigger (which fires on push) with the pull request trigger, or they overlook that branch policy build validation is a separate but equally valid method to trigger a pipeline on PR creation.

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

Pull request trigger in YAML pipeline

Azure DevOps YAML pipelines support a `pr` trigger that automatically runs the pipeline when a pull request is created or updated. This trigger is defined directly in the YAML file and can be scoped to specific branches or paths, making it a native and flexible way to respond to PR events.

Answer analysis

Option-by-option breakdown

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

  • Pull request trigger in YAML pipeline

    Why this is correct

    A YAML pipeline can define a pull request trigger with the 'pr:' keyword, causing the pipeline to run automatically whenever a pull request is created or updated against the specified branch, enabling validation of the proposed changes before merge.

  • Scheduled trigger

    Why it's wrong here

    Scheduled triggers use cron-based schedules in the pipeline definition or UI to run at specific times, such as nightly builds, and are not event-driven; therefore, they will not fire when a pull request is created, making them an invalid choice.

  • Continuous integration trigger

    Why it's wrong here

    Continuous integration (CI) triggers execute on pushes or commits to defined branches, not directly on pull request creation; although a PR may contain commits, the pipeline is triggered by the commit push rather than the PR event itself, so it is not a valid direct trigger.

  • Branch policy with build validation

    Why this is correct

    A branch policy with build validation requires a defined pipeline to run successfully before a pull request can be merged into the protected branch, and Azure DevOps automatically queues this build when a PR is created against that branch, making it a valid way to trigger on PRs.

  • Pipeline completion trigger

    Why it's wrong here

    Pipeline completion triggers start a pipeline based on the completion of another pipeline, whether successful or failed, and are unrelated to pull request events; thus, they cannot be used to trigger a build when a PR is opened.

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.