Configuring a Tag-Based Trigger in Azure Pipelines YAML
You want to trigger a pipeline automatically when a new tag is pushed to a GitHub repository. Which trigger should you configure in the pipeline YAML?
Quick Answer
The trigger block's tags filter — trigger: tags: include: ['*'] or a specific pattern — is what makes a pipeline run automatically on a new Git tag push. It's a distinct trigger type from branch-based push triggers, and it's the direct YAML configuration for tag-driven pipeline runs.
⚠ Common exam trap
Test-takers frequently confuse `trigger:` with `pr:` or `schedules:`, mistakenly thinking any trigger keyword can handle tag events, but only the `tags` sub-property of `trigger:` is designed for Git tag-based automation.
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
✓
trigger: tags:
The `trigger` block in Azure Pipelines YAML supports a `tags` filter that instructs the pipeline to run automatically when a Git tag matching the specified pattern is pushed. By configuring `trigger: tags: include: ['*']` or a specific tag pattern, the pipeline will start on any new tag push to the GitHub repository, which is the exact requirement.
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:
Why it's wrong here
PR trigger is for pull requests.
- ✗
schedules:
Why it's wrong here
Schedules are for cron-based triggers.
- ✓
trigger: tags:
Why this is correct
This is the correct syntax to trigger on tags.
- ✗
resources: pipelines:
Why it's wrong here
This triggers on other pipeline completions.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
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
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 →
Same concept, more angles
1 more way 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. Your team uses GitHub and wants to automate the creation of a new release branch (e.g., release/v1.2.3) whenever a tag starting with 'v' is pushed. Which GitHub Actions trigger should you use?
easy- A.on: release: types: [published]
- ✓ B.on: create: tags: ['v*']
- C.on: push: branches: ['v*']
- D.on: workflow_dispatch: inputs: tag
Why B: GitHub Actions does not support `tags` or `branches` filters on the `create` event. To trigger on tag creation/push, use the `push` event with a `tags` filter. For example: `on: push: tags: ['v*']`. None of the provided options match this valid 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.