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
The following example function triggers and executes every five minutes. The `@TimerTrigger` annotation on the function defines the schedule using the same string format as [CRON expressions](https://en.wikipedia.org/wiki/Cron#CRON_expression).
@@ -76,7 +77,8 @@ public void keepAlive(
76
77
}
77
78
```
78
79
79
-
::: zone-end
80
+
::: zone-end
81
+
80
82
::: zone pivot="programming-language-python"
81
83
82
84
The following example shows a timer trigger binding and function code that uses the binding, where an instance representing the timer is passed to the function. The function writes a log indicating whether this function invocation is due to a missed schedule occurrence. The example depends on whether you use the [v1 or v2 Python programming model](functions-reference-python.md).
@@ -261,6 +267,7 @@ For Python v2 functions defined using a decorator, the following properties on t
261
267
|`use_monitor`| Set to `true` or `false` to indicate whether the schedule should be monitored. Schedule monitoring persists schedule occurrences to aid in ensuring the schedule is maintained correctly even when function app instances restart. If not set explicitly, the default is `true` for schedules that have a recurrence interval greater than or equal to 1 minute. For schedules that trigger more than once per minute, the default is `false`. |
262
268
263
269
For Python functions defined by using *function.json*, see the [Configuration](#configuration) section.
270
+
264
271
::: zone-end
265
272
266
273
::: zone pivot="programming-language-java"
@@ -272,7 +279,8 @@ The `@TimerTrigger` annotation on the function defines the `schedule` using the
::: zone pivot="programming-language-javascript,programming-language-typescript,programming-language-powershell,programming-language-python"
277
285
278
286
## Configuration
@@ -309,7 +317,8 @@ The following table explains the binding configuration properties that you set i
309
317
310
318
---
311
319
312
-
::: zone-end
320
+
::: zone-end
321
+
313
322
::: zone pivot="programming-language-powershell,programming-language-python"
314
323
315
324
@@ -326,7 +335,7 @@ The following table explains the binding configuration properties that you set i
326
335
327
336
<!--The following Include and Caution are from the original file and I wasn't sure if these need to be here-->
328
337
329
-
::: zone-end
338
+
::: zone-end
330
339
331
340
[!INCLUDE [app settings to local.settings.json](../../includes/functions-app-settings-local.md)]
332
341
@@ -340,6 +349,7 @@ See the [Example section](#example) for complete examples.
340
349
When a timer trigger function is invoked, a timer object is passed into the function. The following JSON is an example representation of the timer object.
341
350
342
351
::: zone pivot="programming-language-csharp,programming-language-java,programming-language-powershell,programming-language-python"
352
+
343
353
```json
344
354
{
345
355
"Schedule":{
@@ -353,7 +363,8 @@ When a timer trigger function is invoked, a timer object is passed into the func
353
363
"IsPastDue":false
354
364
}
355
365
```
356
-
::: zone-end
366
+
::: zone-end
367
+
357
368
::: zone pivot="programming-language-javascript,programming-language-typescript"
358
369
```json
359
370
{
@@ -368,7 +379,7 @@ When a timer trigger function is invoked, a timer object is passed into the func
368
379
"isPastDue":false
369
380
}
370
381
```
371
-
::: zone-end
382
+
::: zone-end
372
383
373
384
The `isPastDue` property is `true` when the current function invocation is later than scheduled. For example, a function app restart might cause an invocation to be missed.
374
385
@@ -410,15 +421,15 @@ Here are some examples of NCRONTAB expressions you can use for the timer trigger
410
421
411
422
#### NCRONTAB time zones
412
423
413
-
The numbers in a NCRONTAB expression refer to a time and date, not a time span. For example, a 5 in the `hour` field refers to 5:00 AM, not every 5 hours.
424
+
The numbers in an NCRONTAB expression refer to a time and date, not a time span. For example, a 5 in the `hour` field refers to 5:00 AM, not every 5 hours.
A `TimeSpan` can be used only for a function app that runs on an App Service Plan.
420
431
421
-
Unlike a NCRONTAB expression, a `TimeSpan` value specifies the time interval between each function invocation. When a function completes after running longer than the specified interval, the timer immediately invokes the function again.
432
+
Unlike an NCRONTAB expression, a `TimeSpan` value specifies the time interval between each function invocation. When a function completes after running longer than the specified interval, the timer immediately invokes the function again.
422
433
423
434
Expressed as a string, the `TimeSpan` format is `hh:mm:ss` when `hh` is less than 24. When the first two digits are 24 or greater, the format is `dd:hh:mm`. Here are some examples:
424
435
@@ -464,6 +475,9 @@ Please refer to [manually run a non HTTP-triggered function](./functions-manuall
464
475
465
476
For information about what to do when the timer trigger doesn't work as expected, see [Investigating and reporting issues with timer triggered functions not firing](https://github.com/Azure/azure-functions-host/wiki/Investigating-and-reporting-issues-with-timer-triggered-functions-not-firing).
466
477
478
+
## Connections
479
+
480
+
Timer triggers have an implicit dependency on blob storage, except when run locally through the Azure Functions Core Tools. The system uses blob storage to coordinate across multiple instances [when the app scales out](#scale-out). It accesses blob storage using the host storage (`AzureWebJobsStorage`) connection. If you configure the host storage to use an [identity-based connection](./functions-reference.md#connecting-to-host-storage-with-an-identity), the identity should have the [Storage Blob Data Owner](../role-based-access-control/built-in-roles.md#storage-blob-data-owner) role, which is the default requirement for host storage.
0 commit comments