Skip to content
Latchkey

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: true

Gotchas

  • 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

Run this faster and cheaper on Latchkey managed runners. Start free →