Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change webjob from on demand to schedule

We have an azure webjob that was deployed as on demand. Is there a way to change this to run on a schedule without redeploying?
Not a lot of info out there on this.

I tried creating a new schedule collection like this and adding a job to run the existing webjob, but that didn't seem to work either.

I prefer to do this in the GUI portal, but if its not possible, I'll do it in powershell (if it is possible like that).

(Also, if it can only be changed by redeploying, I need to know that and it effectively answers the question)

like image 318
user2245759 Avatar asked Jan 08 '23 00:01

user2245759


1 Answers

To easily add a schedule to your triggered (on demand) webjob add a file called settings.job at the root of your webjob with this content:

{"schedule": "the schedule as a cron expression"}

Find out more about this here

Note: it'll only work properly for Standard or Premium sites and requires you to set the site as always on.

like image 162
Amit Apple Avatar answered Jan 15 '23 06:01

Amit Apple