A timer-triggered function runs every hour. When the Function App is deployed or restarted, the team wants one run right away, followed by the normal hourly schedule. Which setting provides this?
Show answer and explanation
Answer: B
The timer trigger has a RunOnStartup property. When it is true, the runtime invokes the function once when the host starts, and then the normal schedule continues. In C# it is set as RunOnStartup = true on the TimerTrigger attribute, and in function.json it is the runOnStartup property. Because each restart or new instance triggers the extra run, the team should use it knowingly.
Why the other options are wrong
- A. An HTTP function invoked by the pipeline is an extra moving part the scenario does not need. The timer trigger can handle its own startup run, so this design adds maintenance without a benefit.
- C. A warmup trigger prepares new instances before they receive traffic. It is not a way to call the timer function, so this option does not produce the startup run.
- D. FUNCTIONS_WORKER_RUNTIME selects the language worker, such as dotnet or node. It has no startup scheduling behavior, so changing it would not trigger the timer.
Exam tip. For a run at startup on a timer function, look for the trigger's own startup property.