Home > Back-end >  Only have one instance of an Azure Function?
Only have one instance of an Azure Function?

Time:11-26

I can't find any documentation on how to force an Azure Function v4 into a singleton, so as the function app scales out (for reasons), one of the functions doesn't scale out.

My function is a TIMER TRIGGER, in a v4 .NET6.0 ISOLATED azure function.

Can anyone help, please?

CodePudding user response:

Even if your Function App scales out the timer trigger will only run on a single instance.

If a function app scales out to multiple instances, only a single instance of a timer-triggered function is run across all instances. It will not trigger again if there is an outstanding invocation is still running.

Microsoft docs

CodePudding user response:

This documentation shows direct creation of .net 6 in Azure functions v4 in Visual Studio and this is for working with VS code to the same .Net 6 Azure Functions V4 and this documentation helps you to work with Azure Functions v4 and .Net Core 6 through the command line.

I can't find any documentation on how to force an Azure Function v4 into a singleton, so as the function app scales out (for reasons), one of the functions doesn't scale out.

If a function app scales out to multiple instances, only a single instance of a timer-triggered function is run across all instances. It will not trigger again if there is an outstanding invocation is still running.

Please refer this MSFT documentation for more details and this GitHub thread.

  • Related