问题
Is there a way to schedule a job without having listen to the queue? I mean I would like to run it every hour or so and do something, regardless of the queue. Does that even make sense? One solution I can think of is to queue a message to itself each time the job is done, but that doesn't look like a clean solution to me.
回答1:
Create a scheduled job with a 1 hour frequency and use Host.Call to invoke the function. See the ManualTrigger function in this code sample
回答2:
Of course, no need to listen to a queue. Check the WebJobs documentation on how to schedule a job: http://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/#CreateScheduled
回答3:
The easiest way to schedule a job is to use a TimerTrigger on the WebJob method you'd like to execute on a schedule.
来源:https://stackoverflow.com/questions/24438115/running-azure-webjob-without-queue