Yes, a timer trigger will only run once regardless of the number of instances in your plan, though if it's a short interval then it's possible that one invocation may not have finished before the next one starts. For other trigger types each message will be processed only once (assuming processing is successful) but messages may be processed concurrently, in batches for some trigger types, and by multiple instances. The [Singleton]
attribute will restrict a function to only run one at a time across all instances, but do be aware that if you're on a Consumption Plan then you'll be charged for the runtime of any instance waiting for another instance to complete, which could significantly increase your costs, so it's not recommended.
Functions with Timed trigger and App Service plan multiple instances
Dan Parker
101
Reputation points
Just to make sure, when I autoscale or have multiple instances of my app service plan on a scale up, my functions won't run multiple times right? If it's timer triggered it only does it once.
Anything to worry about in other trigger types? say the Singleton attribute would only be per instance right, and if triggered by a queue, only the 1st instance to get that queue trigger would take it I would assume.
1 answer
Sort by: Most helpful
-
Mark Allan 426 Reputation points
2020-06-06T17:23:04.42+00:00