简体   繁体   中英

HOWTO update schedule of webjob in Azure

I've added some webjobs to an appjob. The webjobs are deplayed from VS together with a new version of the webapp.

TO schedule the jobs I've added a settings.job file to the webjob rootfolder.

If I look in Azure the webjobs are scheduled correctly.

But how to change that schedule from Azure ? The only way to change that schedule now seem to be to change the settings.job file and redeploy from VS.

UPDATE:

given that KUDU does not always work and that the procedure to change the schedule is not really fit for a non-tech user. I started looking at using azure scheduler. But cannot find out how to get it working.

From the webapp|webjob configuration I took the webhookurl, usr, pwd. Created a new schedule using this webhookurl and credentials (basic auth)

But I get this error:

No route registered for ' /api/triggeredwebjobs/<webjobname>/run '

Any suggestions?

how to change settings.job schedule.

  • You could put the settings.job file at the root of WebJob directory and modify it, then redeploy your WebJob project.

  • You could leverage kudu , and navigate to D:\\home\\site\\wwwroot\\app_data\\jobs\\triggered\\<job-name> , then modify the settings.job .

Moreover, you could use the WebJobs API for creating/updating the schedule for a triggered job, and it would automatically create/update the settings.job file for you.

PUT https://{webdeploy-username}:{password}@{your-webapp-name}.scm.azurewebsites.net/api/triggeredwebjobs/{webjob-name}/settings

Body: {"schedule": "*/30 * * * * *"}

I have checked my WebJob log on kudu, it would take some time for the modified schedule to take effort.

I started looking at using azure scheduler. But cannot find out how to get it working.

No route registered for '/api/triggeredwebjobs//run'

For Azure Scheduler , you could refer to David Ebbo's blog here . Based on your error, I assumed that your Http method is wrong, you should use POST . Here is my test, you could refer to it:

在此处输入图片说明

You can also access Kudu (Advanced Tools) at https://yoursite.scm.azurewebsites.net , and modify the settings.job file directly via the Console.

I would recommend you redeploy though so that you have the right schedules in your version control at all times. Otherwise you might publish and then realize you have the old schedules again.

For those who struggle with the same issue :

Best solution turned out to be to use Azure's Scheduler Job Collections. The tricky part was finding out how to set this up.

Action settings: - https - copy the uri you find in the properties page of the webjob to call, it is called 'webhook' - copy the credentials from the same place

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM