0

I have a Timer Trigger Azure function that has process to check a status from DB. Every 10 seconds, function executes and goes to check the status in DB and returns. This function should run until status is 1 or 45 seconds elapsed.

  • Can I stop Azure Timer Trigger function after a specific time or based on a condition?
  • Can I use System.Timers.Timer inside Azure function (non-timer trigger function)?

Please help.

Rahul
  • 1,063
  • 2
  • 11
  • 22
  • You can look for durable functions and can create the `CreateTimer` method of `IDurableOrchestrationContext`, To cancel it, use the `CancellationTokenSource`. However, point to be noted here any insert/update done in activity function can't be rolledback. However as per your question description, program perform the read operation so you would be good for that too. – user1672994 Apr 07 '21 at 17:20
  • Thanks @user1672994 for responding. Sure, I will look into it. You are right, it's a read operation. However I had used System.Timers.Timer which is thread-safe and with it, I am able to do what I wanted to achieve. Still I will look into CreateTimer method of IDurableOrchestrationContext. – Rahul Apr 08 '21 at 20:13

0 Answers0