【问题标题】:TimerTrigger on we bjob with .net core 2.2TimerTrigger on we bjob​​ with .net core 2.2
【发布时间】:2019-06-06 11:55:20
【问题描述】:

我正在使用 Microsoft.Azure.Webjobs (3.0.8),但在编译时出现错误提示

listener for function 'Functions.ProcessCollateFiles' was unable to start.

Inner Exception 1:
ArgumentNullException: Value cannot be null.
Arg_ParamName_Name

我正在查看 nuget 文档中的示例,但看不到导致问题的原因。

我的功能是

public void ProcessCollateFiles([TimerTrigger("0 */1 * * *", RunOnStartup = true)]TimerInfo timerInfo)
        {

               // _logger.Log(LogLevel.Information, "tester");

                Console.WriteLine("test");

        }

我注意到空值是 connectionString 的参数 不过,我不确定 TimerTrigger 的用途是什么

【问题讨论】:

    标签: azure azure-webjobs azure-webjobs-triggered


    【解决方案1】:

    关于您的异常,您可以按照本教程:Configure storage to run locally 设置 AzureWebJobsStorage 字符串。您的 json 将如下所示。

    {
      "ConnectionStrings": {
        "AzureWebJobsStorage": "{storage connection string}"
      }
    }
    

    AzureWebJobsStorage 连接字符串是必需的 - 虽然您可能没有使用任何存储实体,但 WebJobs 运行时确实使用一些 blob 和其他存储实体来进行自己的跟踪和操作。

    只有在使用 WebJobs SDK 时才需要,要使用 Azure WebJobs,您不必使用 WebJobs SDK,因此您不必有AzureWebJobsStorage 连接字符串。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-20
      • 1970-01-01
      • 1970-01-01
      • 2020-08-22
      • 2021-01-04
      • 1970-01-01
      相关资源
      最近更新 更多