AZ-400 Design and implement source control Practice Question
Exhibit
# Azure DevOps pipeline YAML snippet
trigger:
branches:
include:
- main
- release/*
exclude:
- feature/*
pool:
vmImage: 'ubuntu-latest'
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- task: DotNetCoreCLI@2
inputs:
command: 'restore'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: '**/*.csproj'Refer to the exhibit. A developer pushes a commit to a branch named 'feature/new-login'. Which of the following will occur?
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
✓
The pipeline will not trigger because the branch is excluded.
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.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The pipeline will trigger and run all steps because the branch name does not match any exclude pattern.
Why it's wrong here
This is incorrect because the branch name starts with 'feature/', which directly matches the exclude pattern 'feature/*' defined in the pipeline trigger. As a result, the pipeline is explicitly prevented from triggering on this branch, regardless of any include patterns or step definitions. The exclude rule takes precedence and suppresses all pipeline runs for matching branches.
- ✓
The pipeline will not trigger because the branch is excluded.
Why this is correct
The branch in question, e.g., 'feature/ex6lsa', falls under the exclude pattern 'feature/*', which indicates that any branch beginning with 'feature/' is excluded from triggering the pipeline. Therefore, pushing a commit to this branch will not start the pipeline, and no steps (restore, build, test) will execute. This is the expected behavior according to the branch filter configuration.
- ✗
The pipeline will trigger only the restore and build steps, skipping tests.
Why it's wrong here
This is incorrect because the pipeline is not triggered at all, so no steps, including restore, build, or test, will run. The exclude pattern 'feature/*' causes the pipeline to skip the entire execution for this branch, not just a subset of steps. The step visibility is irrelevant since the pipeline never starts.
- ✗
The pipeline will trigger but fail with an error because the branch is not in the include list.
Why it's wrong here
This is incorrect because the exclude rule takes precedence over include rules; the branch is explicitly excluded, so the pipeline will not trigger. There is no error or failure during execution because the pipeline is never initiated. The absence from an include list is irrelevant when an exclude pattern matches the branch name.
Go deeper
Related to this question
Learn chapter
Designing a Build Pipeline
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
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.
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 →
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.