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
+18-58Lines changed: 18 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,8 +76,6 @@ schedules:
76
76
77
77
::: moniker-end
78
78
79
-
::: moniker range="<=azure-devops"
80
-
81
79
Scheduled pipelines in YAML have the following constraints.
82
80
83
81
- 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).
@@ -150,8 +148,6 @@ schedules:
150
148
151
149
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.
152
150
153
-
::: moniker-end
154
-
155
151
::: moniker range=">=azure-devops-2022"
156
152
157
153
### Batch considerations for scheduled triggers
@@ -220,9 +216,7 @@ If your repository is Azure Repos Git, GitHub, or Other Git, then you can also s
220
216
221
217
## Examples
222
218
223
-
#### [YAML](#tab/yaml/)
224
-
225
-
::: moniker range="<=azure-devops"
219
+
:::zone pivot="pipelines-yaml"
226
220
227
221
The following example defines two schedules:
228
222
@@ -253,14 +247,12 @@ The second schedule, **Weekly Sunday build**, runs a pipeline at noon on Sundays
253
247
254
248
For more examples, see [Migrating from the classic editor](#migrating-from-the-classic-editor).
255
249
256
-
:::moniker-end
250
+
:::zone-end
257
251
258
-
#### [Classic](#tab/classic/)
252
+
:::zone pivot="pipelines-classic"
259
253
260
254
#### Example: Nightly build of Git repo in multiple time zones
261
255
262
-
::: moniker range="<=azure-devops"
263
-
264
256
In this example, the classic editor scheduled trigger has two entries, which produce the following builds.
265
257
266
258
* Every Monday - Friday at 3:00 AM (UTC + 5:30 time zone), build branches that meet the `features/india/*` branch filter criteria
@@ -271,14 +263,8 @@ In this example, the classic editor scheduled trigger has two entries, which pro
271
263
272
264

273
265
274
-
::: moniker-end
275
-
276
266
#### Example: Nightly build with different frequencies
277
267
278
-
::: moniker range="<=azure-devops"
279
-
280
-
**Azure Pipelines and Azure DevOps 2019 Server**
281
-
282
268
In this example, the classic editor scheduled trigger has two entries, producing the following builds.
283
269
284
270
* Every Monday - Friday at 3:00 AM UTC, build branches that meet the `main` and `releases/*` branch filter criteria
@@ -289,16 +275,12 @@ In this example, the classic editor scheduled trigger has two entries, producing
289
275
290
276

291
277
292
-
:::moniker-end
278
+
:::zone-end
293
279
294
-
* * *
280
+
:::zone pivot="pipelines-yaml"
295
281
296
282
## Cron syntax
297
283
298
-
#### [YAML](#tab/yaml/)
299
-
300
-
::: moniker range="<=azure-devops"
301
-
302
284
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
285
304
286
```
@@ -370,19 +352,11 @@ Build a UTC cron expression for Monday through Friday at 12:30 AM Central Europe
370
352
371
353
*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
354
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
-
* * *
355
+
:::zone-end
380
356
381
357
## Scheduled runs view
382
358
383
-
#### [YAML](#tab/yaml/)
384
-
385
-
::: moniker range="<=azure-devops"
359
+
:::zone pivot="pipelines-yaml"
386
360
387
361
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
362
@@ -411,10 +385,9 @@ The **Scheduled runs** windows displays the times converted to the local time zo
411
385
> [!NOTE]
412
386
> 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
387
414
-
::: moniker-end
388
+
:::zone-end
415
389
416
-
#### [Classic](#tab/classic/)
417
-
::: moniker range=">= azure-devops-2020"
390
+
:::zone pivot="pipelines-classic"
418
391
419
392
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
393
@@ -424,22 +397,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
406
438
-
::: moniker-end
439
-
440
-
#### [YAML](#tab/yaml/)
441
-
442
-
::: moniker range="<=azure-devops"
407
+
:::zone pivot="pipelines-yaml"
443
408
444
409
To force a pipeline to run even when there are no code changes, you can use the `always` keyword.
445
410
@@ -450,19 +415,17 @@ schedules:
450
415
always: true
451
416
```
452
417
453
-
:::moniker-end
418
+
:::zone-end
454
419
455
-
#### [Classic](#tab/classic/)
456
-
457
-
::: moniker range="<=azure-devops"
420
+
:::zone pivot="pipelines-classic"
458
421
459
422
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
423
461
424

462
425
463
-
:::moniker-end
426
+
:::zone-end
464
427
465
-
* * *
428
+
:::zone pivot="pipelines-yaml"
466
429
467
430
<a name="limits"></a>
468
431
## Limits on the number of scheduled runs in YAML pipelines
@@ -471,7 +434,8 @@ There are certain limits on how often you can schedule a pipeline to run. These
471
434
- around 1000 runs per pipeline per week
472
435
- 10 runs per pipeline per 15 minutes
473
436
474
-
::: moniker range="<=azure-devops"
437
+
:::zone-end
438
+
475
439
## Migrating from the classic editor
476
440
477
441
The following examples show you how to migrate your schedules from the classic editor to YAML.
@@ -568,10 +532,6 @@ In the second schedule, **Sunday 3:00 AM (UTC) weekly latest version build**, th
568
532
* 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
533
* We also specify `always: true` since this build is scheduled to run whether or not the source code has been updated.
570
534
571
-
::: moniker-end
572
-
573
-
::: moniker range=">=azure-devops-2020"
574
-
575
535
## FAQ
576
536
577
537
* [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 +610,4 @@ schedules:
650
610
651
611
For more information, see [Branch considerations for scheduled triggers](#branch-considerations-for-scheduled-triggers).
0 commit comments