question

Prasad-2996 avatar image
0 Votes"
Prasad-2996 asked Prasad-2996 commented

Az Function - different Time trigger running sequentially

We are currently using Linux hosted Consumption Plan (S1:1) - Python
S1 plan
One storage account is used

We have time trigger running at different time
Example:
Time trigger 1 - 04:05 AM - script1.py - this takes 20 minutes to complete
Time trigger 2 - 04:10 AM - script2.py - this takes 15 minutes to complete
NOTE: adjusted the time out to be 30 minutes so the scripts wont time out

Issue: The Time trigger 2 doesn't start until the time trigger 1 completes, is that the expected behavior? If not is there any parameter I could use that the time trigger 2 doesn't wait until the time trigger 1 finishes.





azure-functions
5 |1600 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

MayankBargali-MSFT avatar image
1 Vote"
MayankBargali-MSFT answered Prasad-2996 commented

Hi @Prasad-2996

Timer triggered function app uses TimerTriggerAttribute. This attribute consists of the 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.

You can refer here for more details.

To answer your question as the same storage account is shared the second timer trigger will execute only once the first timer trigger is executed. The suggestion would be to create the timer trigger function in different function app having different storage accounts if the schedule is nearly the same/overlapping with another timer trigger in the same function app.

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

· 1
5 |1600 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.

Thank you @MayankBargali-MSFT for pointing the link.

Apart from creating another function, is there any alternative. would any of the following work?

Triggering a dummy file from ADF --> setting up blob trigger to run the process (would this run parallel instead of sequential) ?
Any other alternative?

0 Votes 0 ·