Azure WebJobs - No functions found - How do I make a trigger-less job?

本小妞迷上赌 提交于 2019-12-03 10:35:34
Victor Hurdugaci

If you don't use any input/output attributes from the WebJobs SDK (QueueTrigger, Blob, Table, etc), you have to decorate the job with the NoAutomaticTrigger Attribute to be recognized by the SDK.

You could use the latest WebJobs SDK, which supports triggering job functions on schedule, based on the same CRON expression format. You can use it to schedule your job every hour:

[Disable("DisableMyTimerJob")]
public static void TimerJob([TimerTrigger("00:01:00")] TimerInfo timerInfo, TextWriter log)
{
    log.WriteLine("Scheduled job fired!");
}

Moreover, the WebJobs SDK also has a DisableAttribute that can be applied to functions, that allows you to enable/disable functions based on application settings. If you change the app setting in the Azure Management Portal, the job will be restarted (https://azure.microsoft.com/en-us/blog/extensible-triggers-and-binders-with-azure-webjobs-sdk-1-1-0-alpha1/).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!