I would like to write a c# Azure Function working on a time trigger in which the schedule would be variable, i.e. each function run would determine the time of the next run and thus should be able to change the scheduled time of the next trigger.
1 Answer
You can use a queue trigger with a queue output for this thanks to the NextVisibleTime property, it's a better choice than attempting to modify the timer schedule every run.
It also supports configurable retries upon failure (and a poison queue) so it's more durable than a timer trigger. (https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue#handling-poison-queue-messages)
3 Comments
donquijote
thanks, will implement and revert, question, what happens if the function fails? would it be no next trigger and thus the process stop?
Carthic
Wondering, is there a similar kind of feature available for Service Bus Topic, where I could process a topic's message by an Azure function based on a time interval?