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)

3 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.

3

In the end the link in the original post I referenced worked. The thing that was missing for me was the understanding that creating a trigger job in scheduler will not affect the run status (on-demand or scheduled) of the web job itself. In my case it stayed "on-demand", but the schedule was in fact running it.

This should point you in the direction on how to do this via PowerShell. It looks possible to add already existing WebJobs to a scheduler.
Create a Scheduled Azure WebJob with PowerShell

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like