Skip to content

Commit 84e0dca

Browse files
Merge pull request #8255 from MicrosoftDocs/users/sdanie/483664
Pipeline scheduled triggers peer review feedback pt1
2 parents 64bebc6 + daef91b commit 84e0dca

File tree

1 file changed

+27
-73
lines changed

1 file changed

+27
-73
lines changed

docs/pipelines/process/scheduled-triggers.md

Lines changed: 27 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
title: Configure schedules to run pipelines
33
description: Configure schedules to run pipelines
44
ms.topic: conceptual
5-
ms.collection: ce-skilling-ai-copilot
65
ms.custom: copilot-scenario-highlight
76
ms.author: sdanie
87
author: steved0x
9-
ms.date: 02/27/2025
8+
ms.date: 09/04/2025
109
ms.update-cycle: 180-days
10+
zone_pivot_groups: pipelines-version
1111
monikerRange: '<= azure-devops'
1212
---
1313

@@ -24,26 +24,22 @@ You can combine scheduled and event-based triggers in your pipelines, for exampl
2424

2525
## Scheduled triggers
2626

27-
#### [YAML](#tab/yaml/)
28-
29-
::: moniker range="<=azure-devops"
27+
:::zone pivot="pipelines-yaml"
3028

3129
> [!IMPORTANT]
32-
> Scheduled triggers defined using the pipeline settings UI take precedence over YAML scheduled triggers.
30+
> Scheduled triggers defined using the YAML pipeline settings UI take precedence over YAML scheduled triggers.
3331
>
3432
> If your YAML pipeline has both YAML scheduled triggers and UI defined scheduled triggers,
3533
> only the UI defined scheduled triggers are run.
3634
> To run the YAML defined scheduled triggers in your YAML pipeline,
37-
> you must remove the scheduled triggers defined in the pipeline settings UI.
35+
> you must remove the scheduled triggers defined in the YAML pipeline settings UI.
3836
> Once all UI scheduled triggers are removed, a push must be made in order for the YAML
3937
> scheduled triggers to start being evaluated.
4038
>
4139
> To delete UI scheduled triggers from a YAML pipeline, see [UI settings override YAML scheduled triggers](../troubleshooting/troubleshoot-triggers.md#ui-settings-override-yaml-scheduled-triggers).
4240
4341
Scheduled triggers configure a pipeline to run on a schedule defined using [cron syntax](#cron-syntax).
4442

45-
::: moniker-end
46-
4743
::: moniker range="<azure-devops-2022"
4844

4945
```yaml
@@ -74,8 +70,6 @@ schedules:
7470

7571
::: moniker-end
7672

77-
::: moniker range="<=azure-devops"
78-
7973
Scheduled pipelines in YAML have the following constraints.
8074

8175
- The time zone for cron schedules is UTC. [You can get AI assistance from GitHub Copilot to create your cron expressions](#use-github-copilot-to-create-a-cron-expression).
@@ -148,8 +142,6 @@ schedules:
148142

149143
Because `release` was added to the branch filters in the `main` branch, but **not** to the branch filters in the `release` branch, the `release` branch won't be built on that schedule. Only when the `release` branch is added to the branch filters in the YAML file **in the release branch** will the scheduled build be added to the scheduler.
150144

151-
::: moniker-end
152-
153145
::: moniker range=">=azure-devops-2022"
154146

155147
### Batch considerations for scheduled triggers
@@ -204,25 +196,21 @@ For more examples, see [schedules.cron examples](/azure/devops/pipelines/yaml-sc
204196

205197
::: moniker-end
206198

207-
#### [Classic](#tab/classic/)
199+
:::zone-end
200+
201+
:::zone pivot="pipelines-classic"
208202

209203
Select the days and times when you want to run the build using the classic editor.
210204

211205
If your repository is Azure Repos Git, GitHub, or Other Git, then you can also specify branches to include and exclude. If you want to use wildcard characters, then type the branch specification (for example, `features/modules/*`) and then press Enter.
212206

213-
::: moniker range="<=azure-devops"
214-
215207
![Scheduled trigger UTC + 5:30 time zone](media/triggers/scheduled-trigger-git-india.png)
216208

217-
::: moniker-end
218-
219-
* * *
209+
:::zone-end
220210

221211
## Examples
222212

223-
#### [YAML](#tab/yaml/)
224-
225-
::: moniker range="<=azure-devops"
213+
:::zone pivot="pipelines-yaml"
226214

227215
The following example defines two schedules:
228216

@@ -253,14 +241,12 @@ The second schedule, **Weekly Sunday build**, runs a pipeline at noon on Sundays
253241

254242
For more examples, see [Migrating from the classic editor](#migrating-from-the-classic-editor).
255243

256-
::: moniker-end
244+
:::zone-end
257245

258-
#### [Classic](#tab/classic/)
246+
:::zone pivot="pipelines-classic"
259247

260248
#### Example: Nightly build of Git repo in multiple time zones
261249

262-
::: moniker range="<=azure-devops"
263-
264250
In this example, the classic editor scheduled trigger has two entries, which produce the following builds.
265251

266252
* Every Monday - Friday at 3:00 AM (UTC + 5:30 time zone), build branches that meet the `features/india/*` branch filter criteria
@@ -271,14 +257,8 @@ In this example, the classic editor scheduled trigger has two entries, which pro
271257

272258
![Scheduled trigger UTC -5:00 time zone](media/triggers/scheduled-trigger-git-nc.png)
273259

274-
::: moniker-end
275-
276260
#### Example: Nightly build with different frequencies
277261

278-
::: moniker range="<=azure-devops"
279-
280-
**Azure Pipelines and Azure DevOps 2019 Server**
281-
282262
In this example, the classic editor scheduled trigger has two entries, producing the following builds.
283263

284264
* Every Monday - Friday at 3:00 AM UTC, build branches that meet the `main` and `releases/*` branch filter criteria
@@ -289,16 +269,12 @@ In this example, the classic editor scheduled trigger has two entries, producing
289269

290270
![Scheduled trigger frequency 2, Azure Pipelines and Azure DevOps 2019 Server.](media/triggers/scheduled-trigger-git-weekly-night.png)
291271

292-
::: moniker-end
272+
:::zone-end
293273

294-
* * *
274+
:::zone pivot="pipelines-yaml"
295275

296276
## Cron syntax
297277

298-
#### [YAML](#tab/yaml/)
299-
300-
::: moniker range="<=azure-devops"
301-
302278
Each Azure Pipelines scheduled trigger cron expression is a space-delimited expression with five entries in the following order. The expression is enclosed in single quotes `'`.
303279

304280
```
@@ -370,19 +346,11 @@ Build a UTC cron expression for Monday through Friday at 12:30 AM Central Europe
370346

371347
*Copilot is powered by AI, so surprises and mistakes are possible. For more information, see [Copilot general use FAQs](https://aka.ms/copilot-general-use-faqs).*
372348

373-
::: moniker-end
374-
375-
#### [Classic](#tab/classic/)
376-
377-
Classic schedules are defined using a graphical editor instead of cron syntax. For information on defining classic schedules, see [Examples](#examples).
378-
379-
* * *
349+
:::zone-end
380350

381351
## Scheduled runs view
382352

383-
#### [YAML](#tab/yaml/)
384-
385-
::: moniker range="<=azure-devops"
353+
:::zone pivot="pipelines-yaml"
386354

387355
You can view a preview of upcoming scheduled builds by choosing **Scheduled runs** from the context menu on the [pipeline details page](../create-first-pipeline.md#view-pipeline-details) for your pipeline.
388356

@@ -411,10 +379,9 @@ The **Scheduled runs** windows displays the times converted to the local time zo
411379
> [!NOTE]
412380
> If you update the schedule for a running pipeline, the **Scheduled runs** view isn't updated with the new schedule until the currently running pipeline completes.
413381
414-
::: moniker-end
382+
:::zone-end
415383
416-
#### [Classic](#tab/classic/)
417-
::: moniker range=">= azure-devops-2020"
384+
:::zone pivot="pipelines-classic"
418385
419386
You can view a preview of upcoming scheduled builds by choosing **Scheduled runs** from the context menu on the [pipeline details page](../create-first-pipeline.md#view-pipeline-details) for your pipeline.
420387
@@ -424,22 +391,14 @@ After you create or update your scheduled triggers, you can verify them using th
424391
425392
![Scheduled runs](media/triggers/scheduled-runs-classic.png)
426393
427-
::: moniker-end
428-
429-
* * *
394+
:::zone-end
430395
431396
<a name="always"></a>
432397
## Running even when there are no code changes
433398
434-
::: moniker range="<=azure-devops"
435-
436399
By default, your pipeline doesn't run as scheduled if there have been no code changes since the last successful scheduled run. For instance, consider that you've scheduled a pipeline to run every night at 9:00pm. During the weekdays, you push various changes to your code. The pipeline runs as per schedule. During the weekends, you don't make any changes to your code. If there have been no code changes since the scheduled run on Friday, then the pipeline doesn't run as scheduled during the weekend.
437400
438-
::: moniker-end
439-
440-
#### [YAML](#tab/yaml/)
441-
442-
::: moniker range="<=azure-devops"
401+
:::zone pivot="pipelines-yaml"
443402
444403
To force a pipeline to run even when there are no code changes, you can use the `always` keyword.
445404

@@ -450,19 +409,17 @@ schedules:
450409
always: true
451410
```
452411

453-
::: moniker-end
454-
455-
#### [Classic](#tab/classic/)
412+
:::zone-end
456413

457-
::: moniker range="<=azure-devops"
414+
:::zone pivot="pipelines-classic"
458415

459416
To configure the scheduled pipeline to build only if there has been a change since the last build, check **Only schedule builds if the source or pipeline has changed**.
460417

461418
![Scheduled trigger UTC + 5:30 time zone](media/triggers/scheduled-trigger-git-india.png)
462419

463-
::: moniker-end
420+
:::zone-end
464421

465-
* * *
422+
:::zone pivot="pipelines-yaml"
466423

467424
<a name="limits"></a>
468425
## Limits on the number of scheduled runs in YAML pipelines
@@ -471,7 +428,8 @@ There are certain limits on how often you can schedule a pipeline to run. These
471428
- around 1000 runs per pipeline per week
472429
- 10 runs per pipeline per 15 minutes
473430

474-
::: moniker range="<=azure-devops"
431+
:::zone-end
432+
475433
## Migrating from the classic editor
476434

477435
The following examples show you how to migrate your schedules from the classic editor to YAML.
@@ -568,10 +526,6 @@ In the second schedule, **Sunday 3:00 AM (UTC) weekly latest version build**, th
568526
* Days of the week - `Sun` - Because our timezone conversions don't span multiple days of the week for our desired schedule, we don't need to do any conversion here. We could also specify the days of the week as `0`.
569527
* We also specify `always: true` since this build is scheduled to run whether or not the source code has been updated.
570528

571-
::: moniker-end
572-
573-
::: moniker range=">=azure-devops-2020"
574-
575529
## FAQ
576530

577531
* [I want my pipeline to run only on the schedule and not when someone pushes a change to a branch](#i-want-my-pipeline-to-run-only-on-the-schedule-and-not-when-someone-pushes-a-change-to-a-branch)
@@ -650,4 +604,4 @@ schedules:
650604

651605
For more information, see [Branch considerations for scheduled triggers](#branch-considerations-for-scheduled-triggers).
652606

653-
::: moniker-end
607+

0 commit comments

Comments
 (0)