locked
Job Scheduler in Window Azure RRS feed

  • Question

  • Hi,

    We are developing window azure site and now we need to create Job Scheduler in sql azure.

    Please give me some examples or suggestions, how to create it. Thanks

    Regards

    Nitin Yadav


    Thursday, January 10, 2013 11:58 AM

Answers

All replies

  • Hi Nitin

    I don't think this is possible in SQL Azure right now, but there are a couple of options:

    1) Use a worker role to schedule jobs.

    2) Use SQL Server Agent on-premise to schedule jobs in SQL Azure.

    Non of these are really an ideal solution.

    Regards,

    Alan


    Free e-book: Windows Azure Service Bus Developer Guide.

    Thursday, January 10, 2013 12:18 PM
  • Hi Alan

    Thanks for you reply. How can we do that by using worker role. Thanks

    Regards

    Nitin Yadav

    Thursday, January 10, 2013 12:27 PM
  • A worker role is indeed the way to do it at present.  You can simply use windows task scheduler in the worker role, or set up a 3rd party scheduler such as VisualCRON.  You could also use a library like Quartz within your worker role.

    Quartz

    VisualCRON

    I would love to say it's straightforward to set up, but it isn't, so see if the task scheduler solves the problem first before moving onto something more complex.

    Thursday, January 10, 2013 12:50 PM
  • Hi,

    Isn't it simplest to schedule the task from the Run method in a worker role? Maybe not as configurable, but easy to get working.

    Alan


    Free e-book: Windows Azure Service Bus Developer Guide.

    Thursday, January 10, 2013 1:40 PM
  • Hi,

    Isn't it simplest to schedule the task from the Run method in a worker role? Maybe not as configurable, but easy to get working.

    Alan


    Free e-book: Windows Azure Service Bus Developer Guide.

    It may be.  In truth, I'm a DBA not a developer so I tend not to play around with this sort of thing too much.  The 3 methods I mentioned above are all scheduling implementations we have used on my current project so I know they are available and that they work. 
    Thursday, January 10, 2013 1:50 PM
  • An alternative solution would be to use the scheduler. For example, you can use it to schedule a stored procedure every X minutes/days/months/...

    Here is a complete tutorial: Build your own SQL Server Agent for Windows Azure SQL Database with the Scheduler


    Sandrino Di Mattia | Twitter: http://twitter.com/sandrinodm | Azure Blog: http://fabriccontroller.net/blog | Blog: http://sandrinodimattia.net/blog

    • Proposed as answer by JuneTEditor Wednesday, January 30, 2013 10:59 AM
    • Marked as answer by Iric Wen Friday, February 1, 2013 7:37 AM
    Thursday, January 10, 2013 11:04 PM
  • or use the Windows Azure Mobile Services Scheduler.

    • Marked as answer by Iric Wen Friday, February 1, 2013 7:37 AM
    Friday, January 11, 2013 1:06 AM
    Answerer
  • Hi Nitin,

    @ present Azure SQL was not support for Job Scheduler so I think better way for you is Worker role.

    Regards,

    Chetan Ramesh Chaudhari

    Wednesday, January 30, 2013 9:19 AM
  • Hi

    You can use single instance Worker role, but you need to write a Power shell command that will add Scheduled task to the instance once it is started (or automatically re-image).

    here is a guide.

    Thanks,

    Shahar

    Thursday, January 31, 2013 2:47 PM
  • Hi Nitin,

    If you do not want to pay the additional cost of a worker role to do this, you can use a service like Cotega to execute stored procedures on a schedule.

    Full disclosure, I work on the Cotega service.

    Tuesday, May 7, 2013 2:47 AM