我是新来的azure网络工作。我正在使用2.0.0版本的Azure扩展和核心。我正在使用this git repo,我了解使用测试版的nigets。此刻我正在我的本地机器上以调试模式运行应用程序。我创建了一个函数,用TimerTrigger运行每分钟。代码如下,Azure Web作业计时器触发器未触发
static void Main()
{
var config = new JobHostConfiguration();
config.UseTimers();
config.Tracing.ConsoleLevel = System.Diagnostics.TraceLevel.Verbose;
if (config.IsDevelopment)
{
config.UseDevelopmentSettings();
}
var host = new JobHost();
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();
}
[NoAutomaticTrigger]
public static void TimerTrig([TimerTrigger("0 * * * * *", RunOnStartup = true)] TimerInfo timer)
{
Console.WriteLine("Triggered");
}
我的问题是, - 无我已经在网上看到的例子使用[NoAutomaticTrigger]属性。但如果我不使用它,作业主机无法找到该函数本身。 - 该功能未触发。我用cron表示法设置了时间,运行start up = true,使跟踪控制台级别变为冗长。
我失踪了什么?
删除'NoAutomaticTrigger'属性:-)您是否尝试过使用不同的CRON表达式? – Thomas