question

DanParker-0340 avatar image
0 Votes"
DanParker-0340 asked ·

Functions with Timed trigger and App Service plan multiple instances

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.

azure-webappsazure-functions
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

markxa avatar image
1 Vote"
markxa answered ·

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.

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.