How to Schedule a Pipeline in Azure Pipelines
Azure Pipelines schedules runs with a schedules: block using cron, branch filters, and an always flag.
Add a schedules: block with a cron expression and branch filters. By default a scheduled run is skipped if nothing changed since the last run - set always: true to force it.
Nightly on main
Runs at 02:00 UTC on main, forcing a run even with no new commits.
azure-pipelines.yml
schedules:
- cron: '0 2 * * *'
displayName: Nightly build
branches:
include:
- main
always: trueGotchas
- Cron times are UTC; there is no timezone field in YAML schedules.
- Without
always: true, scheduled runs are skipped when there are no source changes since the last successful scheduled run. - YAML
schedules:override UI-configured schedules - do not define both for the same pipeline.
Related guides
How to Schedule a GitHub Actions Workflow (Cron)Schedule a GitHub Actions workflow with on.schedule and cron syntax - UTC timing, multiple schedules, and why…
How to Schedule a Pipeline in CircleCISchedule a CircleCI pipeline with scheduled pipeline triggers and config parameters - replacing the deprecate…