I can’t find any 100% answer relating to what happens when an exception occurs during a timer function app.
I have a azure timer function app that then triggers a http function app. Within the http function app an error could happen. I currently log the error and throw. However if I am throwing the error then will the application stop / will the timer function app stop executing until error has been resolved?! I would want my app to continue to run.
Can anyone provide an answer on what happens when throwing exceptions within function app / timer function app? Thanks
The function will be triggered again when it is next due.
Source: I just set up a Azure Function with a timer trigger set to run every 15s. It contained nothing but throw Exception();. It was called multiple times, even though it threw an Exception. I recommend you try it out yourself to get a feeling for it.
PS: If you have logging set up correctly, you will not even need to log a throw - Azure Functions automatically log all unhandled exceptions.
[FunctionName("TriggerFunction")]
public void Run([TimerTrigger("0/15 * * * * *")]TimerInfo myTimer, ILogger log)
{
log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
throw new Exception("boom");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With