My scenario is I will want an azure function/webjob to stand by, the request won't ask it to run directly, but will set up a time to run, when it comes to that moment, it will run. Every request may want to run at different time. Is this possible on Azure function or webjob? or I have to implement this scheduler myself.
You can try using either an Azure Storage Queue triggered or an Azure Service Bus triggered function for your scheduled functionality.
The scheduler function would be a HTTP triggered function which parses the payload and schedules a message into a storage queue or service bus queue.
Note that the following details are for C#. For other languages, you will have to use the appropriate SDK instead of the bindings.
Storage Queues
You will have to set the initialVisibilityDelay
parameter while adding a message using the CloudQueue.AddMessage
method.
You will have to use the queue storage output binding to a CloudQueue object.
Service Bus
You can use the Scheduled Messages feature by setting Message.ScheduledEnqueueTimeUtc
.
You will have to use the service bus output binding to a Message object.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.