AZ-400 Practice Question: Design and implement build and release pipelines
Exhibit
```json
{
"resources": {
"repositories": [
{
"repository": "myrepo",
"type": "git",
"name": "MyProject/myrepo",
"ref": "refs/tags/v1.0"
}
]
},
"trigger":
[
"main"
]
}```Refer to the exhibit. You have a YAML pipeline that references a repository resource with a tag. When will this pipeline trigger?
⚠ Common exam trap
Watch out — candidates often assume a referenced repository resource with a tag will automatically trigger the pipeline on tag pushes, but Azure Pipelines does not trigger on resource changes unless a pipeline resource trigger is explicitly configured.
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
✓
When changes are pushed to the main branch of the current repository.
By default, a YAML pipeline triggers on changes to the main branch of the repository where the pipeline definition resides, even when a repository resource with a tag is referenced. The tag in the repository resource only controls which version of the resource is used at runtime, not the trigger behavior. Without an explicit trigger section, the pipeline uses the default CI trigger on the main branch of the self-repo.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
When a new tag v1.0 is pushed to the referenced repository.
Why it's wrong here
Tags do not trigger a pipeline unless a tag trigger is explicitly defined using the `tags` keyword under `trigger`. The exhibit's trigger is configured for branch pushes to main, not for tags, and it applies to the current repository, not a referenced repository resource.
- ✗
When changes are pushed to any branch of the referenced repository.
Why it's wrong here
The `trigger` element in a YAML pipeline applies only to the repository that contains the pipeline definition, not to repositories listed as `resources`. A branch push to a referenced repository would only trigger this pipeline if that resource had an explicit `trigger` configured, which the exhibit does not show.
- ✓
When changes are pushed to the main branch of the current repository.
Why this is correct
The YAML pipeline defines a branch trigger with `branches.include: main` for the current repository, so any push to the main branch of that repository will automatically start the pipeline. This is the standard CI trigger behavior in Azure Pipelines.
- ✗
The pipeline will never trigger because no trigger is defined.
Why it's wrong here
A trigger is indeed defined: the exhibit shows a `trigger` block that includes the `main` branch of the current repository. If no trigger were defined, the pipeline would either run manually or default to triggering on all branches, but here the explicit main-branch trigger ensures it fires on main pushes.
Go deeper
Related to this question
Learn chapter
Designing a Build Pipeline
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
YAML pipeline
A YAML pipeline is a text-based file written in YAML format that defines an automated series of steps for building, testing, and deploying software in a continuous integration and continuous delivery (CI/CD) system.
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.