【发布时间】:2017-09-28 12:15:44
【问题描述】:
我有一个需要在每天凌晨 1 点运行的网络作业。 我的 settings.job 是这样配置的:
{
"schedule": "0 0 1 * * *",
"is_singleton": true
}
我在 Functions.cs 中声明了函数
namespace Dsc.Dmp.SddUpgrade.WebJob
{
using System;
using System.IO;
using Microsoft.Azure.WebJobs;
public class Functions
{
public static void TriggerProcess(TextWriter log)
{
log.Write($"C# Timer trigger function executed at: {DateTime.Now}");
}
}
}
我收到以下日志:
[09/28/2017 12:02:05 > 9957a4: SYS INFO] Status changed to Running
[09/28/2017 12:02:07 > 9957a4: INFO] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).
当我阅读文档时,有些人正在使用这样的函数签名:
public static void TriggerProcess([TimerTrigger("0 0 1 * * *")] TimerInfo timerInfo, TextWriter log)
但是,这对我来说似乎不合逻辑,因为已经在 settings.job 中安排了我的网络作业。
我在这里错过了什么?
【问题讨论】:
-
我们可以看看你的 Program.cs 的 Main 函数吗?
标签: azure azure-webjobs azure-webjobssdk