You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/pipelines/process/scheduled-triggers.md
+27-73Lines changed: 27 additions & 73 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
title: Configure schedules to run pipelines
3
3
description: Configure schedules to run pipelines
4
4
ms.topic: conceptual
5
-
ms.collection: ce-skilling-ai-copilot
6
5
ms.custom: copilot-scenario-highlight
7
6
ms.author: sdanie
8
7
author: steved0x
9
-
ms.date: 02/27/2025
8
+
ms.date: 09/04/2025
10
9
ms.update-cycle: 180-days
10
+
zone_pivot_groups: pipelines-version
11
11
monikerRange: '<= azure-devops'
12
12
---
13
13
@@ -24,26 +24,22 @@ You can combine scheduled and event-based triggers in your pipelines, for exampl
24
24
25
25
## Scheduled triggers
26
26
27
-
#### [YAML](#tab/yaml/)
28
-
29
-
::: moniker range="<=azure-devops"
27
+
:::zone pivot="pipelines-yaml"
30
28
31
29
> [!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.
33
31
>
34
32
> If your YAML pipeline has both YAML scheduled triggers and UI defined scheduled triggers,
35
33
> only the UI defined scheduled triggers are run.
36
34
> 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.
38
36
> Once all UI scheduled triggers are removed, a push must be made in order for the YAML
39
37
> scheduled triggers to start being evaluated.
40
38
>
41
39
> 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).
42
40
43
41
Scheduled triggers configure a pipeline to run on a schedule defined using [cron syntax](#cron-syntax).
44
42
45
-
::: moniker-end
46
-
47
43
::: moniker range="<azure-devops-2022"
48
44
49
45
```yaml
@@ -74,8 +70,6 @@ schedules:
74
70
75
71
::: moniker-end
76
72
77
-
::: moniker range="<=azure-devops"
78
-
79
73
Scheduled pipelines in YAML have the following constraints.
80
74
81
75
- 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:
148
142
149
143
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.
150
144
151
-
::: moniker-end
152
-
153
145
::: moniker range=">=azure-devops-2022"
154
146
155
147
### Batch considerations for scheduled triggers
@@ -204,25 +196,21 @@ For more examples, see [schedules.cron examples](/azure/devops/pipelines/yaml-sc
204
196
205
197
::: moniker-end
206
198
207
-
#### [Classic](#tab/classic/)
199
+
:::zone-end
200
+
201
+
:::zone pivot="pipelines-classic"
208
202
209
203
Select the days and times when you want to run the build using the classic editor.
210
204
211
205
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.
212
206
213
-
::: moniker range="<=azure-devops"
214
-
215
207

216
208
217
-
::: moniker-end
218
-
219
-
* * *
209
+
:::zone-end
220
210
221
211
## Examples
222
212
223
-
#### [YAML](#tab/yaml/)
224
-
225
-
::: moniker range="<=azure-devops"
213
+
:::zone pivot="pipelines-yaml"
226
214
227
215
The following example defines two schedules:
228
216
@@ -253,14 +241,12 @@ The second schedule, **Weekly Sunday build**, runs a pipeline at noon on Sundays
253
241
254
242
For more examples, see [Migrating from the classic editor](#migrating-from-the-classic-editor).
255
243
256
-
:::moniker-end
244
+
:::zone-end
257
245
258
-
#### [Classic](#tab/classic/)
246
+
:::zone pivot="pipelines-classic"
259
247
260
248
#### Example: Nightly build of Git repo in multiple time zones
261
249
262
-
::: moniker range="<=azure-devops"
263
-
264
250
In this example, the classic editor scheduled trigger has two entries, which produce the following builds.
265
251
266
252
* 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
271
257
272
258

273
259
274
-
::: moniker-end
275
-
276
260
#### Example: Nightly build with different frequencies
277
261
278
-
::: moniker range="<=azure-devops"
279
-
280
-
**Azure Pipelines and Azure DevOps 2019 Server**
281
-
282
262
In this example, the classic editor scheduled trigger has two entries, producing the following builds.
283
263
284
264
* 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
289
269
290
270

291
271
292
-
:::moniker-end
272
+
:::zone-end
293
273
294
-
* * *
274
+
:::zone pivot="pipelines-yaml"
295
275
296
276
## Cron syntax
297
277
298
-
#### [YAML](#tab/yaml/)
299
-
300
-
::: moniker range="<=azure-devops"
301
-
302
278
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 `'`.
303
279
304
280
```
@@ -370,19 +346,11 @@ Build a UTC cron expression for Monday through Friday at 12:30 AM Central Europe
370
346
371
347
*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).*
372
348
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
380
350
381
351
## Scheduled runs view
382
352
383
-
#### [YAML](#tab/yaml/)
384
-
385
-
::: moniker range="<=azure-devops"
353
+
:::zone pivot="pipelines-yaml"
386
354
387
355
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.
388
356
@@ -411,10 +379,9 @@ The **Scheduled runs** windows displays the times converted to the local time zo
411
379
> [!NOTE]
412
380
> 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.
413
381
414
-
::: moniker-end
382
+
:::zone-end
415
383
416
-
#### [Classic](#tab/classic/)
417
-
::: moniker range=">= azure-devops-2020"
384
+
:::zone pivot="pipelines-classic"
418
385
419
386
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.
420
387
@@ -424,22 +391,14 @@ After you create or update your scheduled triggers, you can verify them using th
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.
437
400
438
-
::: moniker-end
439
-
440
-
#### [YAML](#tab/yaml/)
441
-
442
-
::: moniker range="<=azure-devops"
401
+
:::zone pivot="pipelines-yaml"
443
402
444
403
To force a pipeline to run even when there are no code changes, you can use the `always` keyword.
445
404
@@ -450,19 +409,17 @@ schedules:
450
409
always: true
451
410
```
452
411
453
-
::: moniker-end
454
-
455
-
#### [Classic](#tab/classic/)
412
+
:::zone-end
456
413
457
-
:::moniker range="<=azure-devops"
414
+
:::zone pivot="pipelines-classic"
458
415
459
416
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**.
460
417
461
418

462
419
463
-
:::moniker-end
420
+
:::zone-end
464
421
465
-
* * *
422
+
:::zone pivot="pipelines-yaml"
466
423
467
424
<a name="limits"></a>
468
425
## 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
471
428
- around 1000 runs per pipeline per week
472
429
- 10 runs per pipeline per 15 minutes
473
430
474
-
::: moniker range="<=azure-devops"
431
+
:::zone-end
432
+
475
433
## Migrating from the classic editor
476
434
477
435
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
568
526
* 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`.
569
527
* We also specify `always: true` since this build is scheduled to run whether or not the source code has been updated.
570
528
571
-
::: moniker-end
572
-
573
-
::: moniker range=">=azure-devops-2020"
574
-
575
529
## FAQ
576
530
577
531
* [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:
650
604
651
605
For more information, see [Branch considerations for scheduled triggers](#branch-considerations-for-scheduled-triggers).
0 commit comments