Courseiva
Design and implement a source control strategyhardMultiple ChoiceObjective-mapped

Why Only the Pull Request Build Runs, Not a Separate CI Build

Exhibit

Refer to the exhibit.
```yaml
# azure-pipelines.yml
trigger:
  branches:
    include:
      - main
      - release/*
pr:
  branches:
    include:
      - main
```

Your Azure Pipeline is configured as shown in the exhibit. A developer pushes a commit to a feature branch named 'feature/new-login' and creates a pull request targeting the main branch. Which pipeline runs will be triggered?

Quick Answer

With a PR trigger configured for the main branch but no matching CI trigger on the feature branch itself, only the PR build runs when a developer opens a pull request from feature/new-login into main — pushing to the feature branch directly doesn't start a separate CI build in this configuration.

⚠ Common exam trap

Many exam-takers assume a push to a feature branch automatically triggers a CI build, but the CI trigger's branch filter must explicitly include the branch; otherwise, only the PR trigger (if configured) will fire.

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

Only a PR build

The pipeline is configured with a PR trigger that activates on pull requests targeting the main branch. When a developer pushes a commit to 'feature/new-login' and creates a PR to main, only the PR build is triggered. The CI trigger is not configured for the feature branch (only for main), so no CI build runs on the feature branch itself.

Answer analysis

Option-by-option breakdown

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

  • No pipeline runs

    Why it's wrong here

    PR build runs.

  • Only a PR build

    Why this is correct

    PR trigger matches main branch.

  • Only a CI build on the feature branch

    Why it's wrong here

    PR build is triggered.

  • Both a CI build on the feature branch and a PR build

    Why it's wrong here

    CI is not triggered for feature branches.

About these practice questions

One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

3 more ways this is tested on AZ-400

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. Refer to the exhibit. A developer pushes a commit to a branch named 'feature/new-login'. Which of the following will occur?

medium
  • A.The pipeline will trigger and run all steps because the branch name does not match any exclude pattern.
  • B.The pipeline will not trigger because the branch is excluded.
  • C.The pipeline will trigger only the restore and build steps, skipping tests.
  • D.The pipeline will trigger but fail with an error because the branch is not in the include list.

Why B: The trigger includes main and release/* branches, and explicitly excludes feature/* branches. Since 'feature/new-login' matches the exclude pattern 'feature/*', the pipeline will not trigger. The pipeline will only trigger for branches that match include patterns and do not match exclude patterns. 'feature/new-login' is excluded, so no build will start.

Variation 2. You see the above YAML pipeline trigger configuration in an Azure Pipeline. The repository uses Git Flow with branches: feature/new-feature, develop, release/v1.0, and main. A developer pushes a commit to the branch feature/new-feature. Which action will trigger the pipeline?

easy
  • A.A CI trigger will start because the branch name starts with 'feature/'.
  • B.No trigger will start.
  • C.A PR trigger will start because the branch name contains 'feature'.
  • D.A CI trigger will start for all branches because batch is set to true.

Why B: The YAML trigger configuration (shown) explicitly lists the branches that trigger CI. Since feature/new-feature is not included in the branch filter, a push to that branch does not start a CI run. PR triggers are separate and require an actual PR to be created, not a push.

Variation 3. You are configuring a continuous integration trigger in Azure Pipelines for a repository in Azure Repos. You want to trigger a build for all branches except the 'release' branch. How should you configure the trigger?

easy
  • A.Set trigger: branches: include: - main
  • B.Set trigger: branches: include: - '*' exclude: - '*'
  • C.Set trigger: branches: include: - '*' exclude: - release
  • D.Set trigger: branches: exclude: - release

Why D: In Azure Pipelines YAML triggers, the 'include' list is optional. If no include is specified, all branches are considered for triggering, and the 'exclude' list removes the specified branches. Therefore, 'trigger: branches: exclude: - release' correctly triggers on all branches except 'release'. The marked answer C also works, but D is the simpler and standard configuration.

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.