Azure的WebJob /调度从8:00-18:00,每30分钟? [英] Azure WebJob/Scheduler every 30 minutes from 8am-6pm?

查看:308
本文介绍了Azure的WebJob /调度从8:00-18:00,每30分钟?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我去配置在Azure管理控制台时间表,我只给调度以绝对的结束日期/时间的选项(或上房)和时间间隔。

When I go to configure a Schedule in the Azure management console, I'm only given the option of scheduling with an absolute end date/time (or never ending) and an interval.

在这里输入的形象描述

所以我不能,从这个UI,安排作业运行,每天上午8:00至下午6:00,每30分钟的只有的(即不从6运行:下午1时至上午7:59)。 Windows任务管理器和所有其他调度(cron的石英)我用以前支持我想要的行为。

So I can't, from this UI, schedule a job to every 30 minutes run every day from 8:00 AM to 6:00 PM only (i.e. don't run from 6:01 PM to 7:59 AM). Windows Task Manager and all other schedulers (cron, quartz) I've used before support the behaviour I want.

时在Azure中,例如支持在所有时间表类型通过API或hackish的使用门户网站HTTP / JSON接口?我不介意黑客的日程安排一次 - 它会击败嵌入到时间表的实际作业脚本/应用

Is type of schedule supported at all in Azure, e.g. through the API or a hackish use of the Portal HTTP/JSON interfaces? I don't mind "hacking" the schedule once - it would beat embedding the schedule into the actual job script/application.

推荐答案

您可以使用内置的调度比在Azure更加灵活。
您可以了解更多有关如何从这个博客帖子<一个作品href=\"http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/\">http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/

You can use the built-in scheduling which is more flexible than the Azure one. You can learn more about how that works from this blog post http://blog.amitapple.com/post/2015/06/scheduling-azure-webjobs/

摘要:创建一个名为 settings.job 包含下面这段的JSON

The summary: create a file called settings.job that contains the following piece of json

{"schedule": "cron expression for the schedule"}

在你的情况为从上午8时至下午6时,每30分钟的前的cron pression将 0,30 8-18 * * *

in your case the cron expression for "every 30 minutes from 8am to 6pm" would be 0,30 8-18 * * *

所以你想要的JSON是

so the JSON you want is

{"schedule": "0,30 8-18 * * *"}

请记住,这使用计算机,这是UTC默认的时区。

Keep in mind that this uses the timezone of the machine, which is UTC by default.

这篇关于Azure的WebJob /调度从8:00-18:00,每30分钟?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆