Home > Asp.net > How to Schedule Jobs in Windows Azure Worker Roles

How to Schedule Jobs in Windows Azure Worker Roles

The following is an example that demonstrates how I was able to successfully schedule jobs.

Start by implementing the IJob interface to create a job that can be managed by Quartz.Net.

Then in the RoleEntryPoint OnStart() method create and configure the scheduler with a trigger and the daily job. This is the part that was greatly lacking in documentation. To get this working I had to poke around the available methods and objects

using IntelliSense. Once you have created the scheduler, be sure to keep a reference to it in your Worker Role instance. This will ensure that your jobs execute.

 

When configuring a time based job, its quite important to keep in mind that all Windows Azure servers utilize UTC time, and ‘en-US’ locale settings. It’s imperative that you make sure that your job is scheduled to execute in the right time zone. Use TimeZoneInfos to get the correct time zone info object.

 

This Article is TAGGED in , , , . BOOKMARK THE permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">