Function app timer trigger high availability

Dane Bezuidenhout 21 Reputation points
2022-06-07T10:42:36.093+00:00

As per https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=in-process&pivots=programming-language-csharp, only a single timer-triggered function is run in a scaled-out scenario, presumably using the function state storage to ensure this.

In a scaled-out scenario, does a crashed / failed timer-triggered function or does an instance of the function app that becomes unavailable result in a second function starting up in the other function app instance? i.e. is there automatic failover?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,321 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,958 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,436 Reputation points
    2022-06-08T07:10:12.037+00:00

    Hi @Dane Bezuidenhout ,

    Thanks for reaching out to Q&A forum.

    As mentioned in the document, the Timer trigger will always run on a single instance. Whenever there is a crash at the worker level or at the Function host level, the host will recover on its own and it will restart. However if an execution is scheduled and the worker/host fails, the execution will be missed.

    In order to overcome this scenario, you can have a retry mechanism in place. If you are running ~v3 functions, you can make use of the inbuilt retry policy in Functions.

    Retry policy in Functions : https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-error-pages?tabs=csharp#retry-policies-preview

    I would also suggest you to enable the healthcheck feature in the functions so that this feature would restart a particular instance if that is unhealthy.

    Healthcheck : https://learn.microsoft.com/en-us/azure/app-service/monitor-instances-health-check?tabs=dotnet#enable-health-check

    I hope this helps! Feel free to reach out to me if you have any questions or concerns.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments