I have a timer function that runs every 15 minutes (pseudo-code below). Due to a vendor issue in the 3rd party service, we would see failures followed by stretches (45 minutes, 6 hours, etc.) where the timer function did not execute.
public static class ThirdPartySynchronization { private static readonly ThirdPartySdk s_thirdPartySdk = new ThirdPartySdk(); [FunctionName("TimerTriggerCSharp")] public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log) { try { await s_thirdPartySdk.Synchronize(); } catch (Exception ex) { log.Error(ex.Message); throw; } } } When I run the function locally and hit the same error sate, the throw occasionally crashes the func.exe host, which made me wonder if a similar issue occurs in our Consumption Plan.
I don't see a lot of guidance in Azure's documentation or best practices for how to handle exceptions (or mark a timer function as non-success). Any recommended pattern for handling exceptional behavior in C# Azure timer functions?