I have a time-triggered azure function triggered every 1 hour. My requirement is that, it should get triggered every hour but once also immediately after the deployment ? Is playing with cron expression my only way for this ?
Asked
Active
Viewed 3,300 times
1 Answers
3
There isn't something directly tied to the deployment. The runOnStartup
setting, documented here, triggers your function when the runtime starts, but won't cause the runtime to start as a result of a deployment.
Your best option would likely be to customize your deployment, as documented here, and invoke your function (by issuing an HTTP request) once the deployment completes. You can share the code and have an HTTP triggered function that uses the same logic as the timer function that runs on a schedule.

Fabio Cavalcante
- 12,328
- 3
- 35
- 43
-
What is meant by runtime starts in the context of time-triggered azure functions ? – Tany Jun 16 '17 at 10:29
-
I am referring to your comment "..triggers your function when the **runtime starts**.." – Tany Jun 19 '17 at 15:50
-
Ah, yes, what I mean is the runtime start on a given worker/instance, which may happen as a result of scaling, restarts due to function changes or when your app wakes up after going idle due to inactivity. – Fabio Cavalcante Jun 19 '17 at 19:56
-
If this is for an internal process that can have access to the function's master key, then now there's an alternative to creating a second HTTP triggered function: A REST API to trigger the function manually offerred by Azure ([docs](https://learn.microsoft.com/mt-mt/Azure/azure-functions/functions-manually-run-non-http)) – Slawomir Brzezinski Jan 09 '19 at 11:11