0

I am trying azure scheduler and could not find a way to set below scenarios in azure scheduler's job,

  1. Job run every 60 min between 8 am to 8 pm
  2. job run every 40-80 min (shoud be random) between 7 am to 7 pm

Any above scenario possible by portal?

Thanks.

mathewc
  • 13,312
  • 2
  • 45
  • 53
Arun Rana
  • 8,426
  • 14
  • 67
  • 107

1 Answers1

1

for the question 1, you may use the REST API to configure your advanced schedule task :

 {
 "recurrence":                     
  {
    "schedule":                   
    {
        "hours": [8,9,10,11,12,13,14,15,16,17,18,19,20]                      
    },
 },
}

For the question 2, I would use a first scheduled job that occurs every 80 mn between 7 & 7 PM (same kind of solution as 1) and this job would activate (or create) a one time running job with a delay value between 40 & 80 randomly computed. The update (or creation) would use REST API (again) or PowerShell (because it would be a simpler schedule with Set-AzureSchedulerHttpJob Cmdlet documented here https://github.com/Azure/azure-content/blob/master/articles/scheduler/scheduler-powershell-reference.md)

You may also use a triggered Webjob instead of a schedule job with a NCRONTAB expression such as 0 */59 8-20 * * * . In order to do this, you'll need to change the properties of the settings.job (but you still have to get 2 jobs in order to handle your randomize schedule...) This kind of advanced scheduling Azure WebJobs with cron expressions is documented here http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/#.VoUtRGxIhZE

Hope this helps Best regards Happy new year ! Stéphane

stephgou
  • 199
  • 2