BrainyBeeBrainyBee
ExploreBlogStart Studying
HomeDesigning and Implementing Microsoft DevOps Solutions (AZ-400)Pipeline trigger rules
Lesson393 words

Pipeline trigger rules

Develop and implement pipeline trigger rules

Triggers decide when a pipeline runs. The defaults depend on the repository provider and on settings outside the YAML file.

Omitted triggers are conditionally on

With Disable implied YAML CI trigger off and no pipeline UI override, an omitted trigger enables CI for pushes to all branches. The organization or project setting is off by default.

For GitHub and Bitbucket Cloud, omitting pr enables YAML PR builds for pull requests to any branch when no UI override applies. Azure Repos Git does not use YAML pr triggers; configure branch-policy build validation instead.

Disable CI explicitly with trigger: none. For a GitHub or Bitbucket Cloud YAML pipeline, disable YAML PR builds with pr: none:

yaml
trigger: none # no CI trigger pr: none # no PR trigger

Keep two controls separate:

  • Disable implied YAML CI trigger is an organization/project control. It suppresses implicit CI only when trigger is omitted; it does not defeat an explicit trigger: none.
  • Override the YAML trigger from here is a per-pipeline UI control that can supersede explicit YAML trigger and supported pr settings.

Filtering

yaml
trigger: branches: include: [ main, releases/* ] exclude: [ releases/legacy/* ] paths: include: [ src/* ] exclude: [ docs/* ] batch: true
  • Exclude beats include. A branch matching both is excluded.
  • Path filters stop documentation-only commits from burning agent time.
  • batch: true collects commits arriving during an in-flight run and runs them together when it finishes, instead of queueing one run per push.

Scheduled triggers

yaml
schedules: - cron: "0 2 * * *" displayName: Nightly branches: include: [ main ] always: false

always: false — the default — runs only when source code or pipeline settings have changed since the last successful scheduled run. Set it to true for jobs that must run despite unchanged repository state, such as a nightly dependency scan whose useful input is an external advisory feed.

Cron here is UTC, which is the usual source of "why did it run an hour early" after a daylight-saving change.

UI-defined schedules take precedence over YAML schedules. If both exist, only the UI schedules run until they are removed and a push refreshes YAML schedule evaluation.

Primary sources

  • https://learn.microsoft.com/en-us/azure/devops/pipelines/build/triggers
  • https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/trigger
  • https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/pr
  • https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/github
  • https://learn.microsoft.com/en-us/azure/devops/pipelines/process/scheduled-triggers
  • https://learn.microsoft.com/en-us/azure/devops/pipelines/troubleshooting/troubleshoot-triggers
All Designing and Implementing Microsoft DevOps Solutions (AZ-400) Study Resources

Related Notes

  • Agent and runner infrastructure533 words
  • Agent and runner infrastructure — quick notes222 words
  • Alerting on pipeline events255 words
  • Alerting on pipeline events — quick notes94 words
  • Analyzing usage and application performance241 words
  • Analyzing usage and application performance — quick notes73 words
  • Appropriate access levels294 words
  • Appropriate access levels — quick notes180 words
  • Automating container scanning277 words
  • Automating container scanning — quick notes96 words
  • Automating documentation from Git history191 words
  • Automating documentation from Git history — quick notes55 words

Ready to study Designing and Implementing Microsoft DevOps Solutions (AZ-400)?

Practice tests, flashcards, and all study notes — free, no sign-up.

Start Studying

Ready to study Designing and Implementing Microsoft DevOps Solutions (AZ-400)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free
Designing and Implementing Microsoft DevOps Solutions (AZ-400) ResourcesExplore All HivesBlogHome

© 2026 BrainyBee. Free AI-powered exam prep.