I have an application that sends automatic mails via a worker role.
When I debug my application in Visual Studio my task that I set OnStart() in the WorkerRole.cs works perfectly, I receive a mail every 5 minutes (for test purposes).
My Code in WorkerRole.cs:
public override bool OnStart()
{
ScheduledTaskTimer.Elapsed += new ElapsedEventHandler(ScheduledTaskTimer_Elapsed);
// ScheduledTaskTimer.Interval = 86400000;
ScheduledTaskTimer.Interval = 180000;
ScheduledTaskTimer.Enabled = true;
return base.OnStart(); }
But when I deploy to Windows Azure, my worker role does not seem to work.
I never receive any mail.. I don’t know how to check if the worker role is actually running..
Please Study my comments in the question below:
Webrole is not starting and always busy
For a worker role you dont need to follow step 2) above if you don’t have a web server running, still you can all other steps to troubleshoot this issue.