Can a timed Azure Function run multiple instances at the same time?

David 21 Reputation points
2020-07-10T20:10:29.657+00:00

I have an Azure function that runs every 2 min. It is possible that processing may take longer than 2 min. Does the function 'stack and wait' till the first is done before running or could two instances of the same function app be running concurrently? In my case, I do not want two instances to be running concurrently so am looking for a way to ensure that does not happen. Any insight on this? Thx in advance.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,322 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 23,106 Reputation points Microsoft Employee
    2020-07-14T06:06:40.287+00:00

    Hello @David

    Thank you for reaching out. I am sorry for the delay in my response.
    Timer triggered function app uses TimerTriggerAttribute. This attribute consists of Singleton Lock feature which ensures that only a single instance of the function is running at any given time. If any process runs longer than the scheduled timer, the new incoming process waits for the older process to finish and then uses the same instance.
    Please comment here if you have any further questions, I will be happy to continue with our discussion.

    1 person found this answer helpful.