Azure Web Job

时间:2017-09-15 07:23:33

标签: azure-webjobs

static void Main()
{
var config = new JobHostConfiguration();
config.UseTimers();   
var host = new JobHost(config);
host.RunAndBlock();
}

public static void TimerTrig1([TimerTrigger("00:00:02")] TimerInfo timer)
{
    Console.WriteLine("Triggered");
}  

public static void TimerTrig2([TimerTrigger("00:00:04")] TimerInfo timer)
{
    Console.WriteLine("Triggered");
}  

我已经在azure上发布了该代码,但它给了我错误 Click for Error但我通过在Azure门户Click for Image 上设置连接字符串来解决此问题。但仍然注意到了。我的方法没有触发。

1 个答案:

答案 0 :(得分:0)

 I have published that code on azure but it give me error Click for Error 
 that "** System.InvalidOperationException: Failed to validate Microsoft 
 Azure WebJobs SDK Dashboard connection string**. " I resolve it by setting 
 connection string on Azure portal [enter image description here][1] [Click 
 for detail][2]. but still noting happened. My Methods were not triggering 
 so after that i Fund out that i have to make my methods public like this 
 [enter image description here][3]. And Finally it run. Output [enter image 
 description here][4]