Hello @Sagar Rallapalli , You may consider using WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT and limit it to the minimum. However, remember this will be applied at the function app level.
You can check system.threading.semaphoreslim or system.threading.mutex and try to handle it in code.
There are couple of related discussions :
https://github.com/Azure/azure-functions-host/issues/5972
https://github.com/Azure/azure-functions-host/issues/1054
https://stackoverflow.com/questions/52836451/azure-function-app-run-single-azure-function-locally-to-debug
--------------------------------------------------------------------------------
UPDATE
[I have checked this scenario at my end and discussed with the core product team. Sharing the suggestion based on that]
This is a unique scenario where you want to specify the limit at function level.
First, we cannot use any Host.json settings as those are host level, not function specific.
Second, Any batch setting wouldn't be applied to timers.
Third, w.r.t locking, if the app is scaled out to several instances, different timers/functions may be running on different instances, so it is not advisable to use in memory locking to synchronize.
Hence, one workaround could be redefining the schedules as per https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=csharp#ncrontab-expressions so that the schedules don't overlap.
e.g. : The first function runs on the 20 and 40 minute marks of every hour, the second on the 30 minute mark, and the last at the top of the hour.
crontab.guru
You may check durable-functions-singletons too.
Please let me know if this helps!
If yes , please "Accept the answer" and "Up-vote" so that it helps others in the community.