2

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?

1

1 Answer 1

1

There is no guidlance for timertrigger: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages

Best what you can do:

  1. Analyze function execution logs: https://learn.microsoft.com/en-us/azure/azure-functions/functions-monitoring
  2. Manage function timeout: https://learn.microsoft.com/en-us/azure/azure-functions/functions-host-json#functiontimeout. For consumption plan it's 10 minutes max.
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.