Perform Tasks at Different Intervals in Azure Worker Role Perform Tasks at Different Intervals in Azure Worker Role azure azure

Perform Tasks at Different Intervals in Azure Worker Role


The first two options are the simplest but they are brittle - especially in the cloud where roles can be recycled/load balanced etc... If the persistence is in memory or even disk based in the cloud, then it will be brittle.

Outside of other third party options, you could look at persisting the schedule and execution data into external storage (table services, sql azure, etc...). On a periodic timer, the worker role can query for the jobs that are due to be performed, record starting and then run the job. That also allows you to potentially scale out the number of worker roles since it's persistence is external.

This can get complicated in a hurry but if you keep it simple with frequency and recording run times, it can be fairly straight forward.


Steve Marx wrote a nice couple of blog entries on how to build a task scheduler on Windows Azure using blob leases, I think you will find this very useful.