如何将 azure webjob 配置为每 30 秒 运行

How to configure azure webjob to run every 30 seconds

这应该很快 - 我知道如何 运行 .net webjobs 精简到每一分钟.. 例如 0 0/1 * 1/1 * *

但我想 运行 每 10 秒!!我可以找到 unix 方法,但没有 azure webjobs / ,net examples..

模式似乎类似于 Cron 计划作业

*/10 * * * *

https://crontab.guru

要计划触发的 WebJob,您需要将计划 属性 添加到 settings.job 文件。 schedule 的值是 cron 表达式,它有 6 个字段来表示 schedule:{second} {minute} {hour} {day} {month} {day of the week}.

因此,如果您想每 10 秒 运行,只需将以下内容添加到 settings.job 文件中即可。

{
  "schedule": "*/10 * * * * *"
}

If your app runs continuous or scheduled WebJobs, enable Always On to ensure that the WebJobs run reliably. This feature is available only in the Basic, Standard, and Premium pricing tiers.

更多细节,你可以参考这个article.