CodeQuest
CodeQuest

Reputation: 123

Azure WebJob fails to run on its schedule but it ran when I uploaded the bat file and never ran again

I created a WebJob as a Triggered job to run on a Schedule. When I uploaded the file it was accepted by the form and I went ahead and clicked RUN because I figured you have to click RUN right after uploading it so that it knows it can go ahead and start running. (I am not sure if I actually have to click RUN, or if I should have just uploaded it and let it be so it should just run on its own according to the CRON Expression provided.)

enter image description here

enter image description here

Well, the job ran as soon as I clicked start and it succeeded which was good news. The issue is, it was supposed to run on its schedule every 4 hours, but never did. It only ran once, which was the time I clicked start.

The CRON Expression I created for it is **0 50 23/4 * * *** which translates to: At 50 minutes past the hour, every 4 hours, starting at 11:00 PM.

Basically I need the job to run every 4 hours but most importantly at 11:50pm which is why I set that as the schedule. So it should run at 11:50pm, 3:50am, 7:50am, 11:50am, 3:50pm, 7:50pm 11:50pm everyday.

I uploaded the job at about 10pm and it ran at that time because I clicked on RUN but was still expecting it to do its REAL SCHEDULED RUN at 11:50 pm but it never did. The logs show success for that initial run as you can see below.

enter image description here

When I look at the WebJob area in Azure the next day, it shows completed 17 hours ago and only ran once at the time of writing this.

What could be my error here? Is it something wrong with the CRON Expression that I have provided for the job? Before this one I made one that would run every 2 minutes and that one worked perfectly fine, but this one with a more complex CRON Expression seems to give me issue.

What could be my problem here?

Upvotes: 0

Views: 74

Answers (1)

CodeQuest
CodeQuest

Reputation: 123

I was able to fix this issue scrapping everything and starting over. I was using the incorrect CRON Expression for the trigger times I needed. Also found out that I could just upload the file and not have to click the RUN button since it will just run on its own following the given expression.

Upvotes: 0

Related Questions