从计时器触发的另一个调用Azure函数

时间:2020-03-05 19:15:36

标签: azure azure-functions azure-functions-core-tools timer-trigger

我想从计时器触发的azure函数中调用另一个(非计时器触发的)azure函数。 它可以编译,但是在运行时出现错误:

System.ArgumentException: 'The function 'HelloWorld' doesn't exist, is disabled, or is not an orchestrator function. Additional info: No orchestrator functions are currently registered!'

我将其简化为这个小代码段。

    [FunctionName("HelloWorld")]
    public static string HelloWorld([ActivityTrigger] string name, ILogger log)
    {
        return $"Hello {name}!";
    }

    [FunctionName("DownloadLiveList")]
    public async void DownloadLiveList([DurableClient] IDurableOrchestrationClient client, [TimerTrigger("0 0 0 * * *", RunOnStartup = true)]TimerInfo myTimer, ILogger log)
    {
        await client.StartNewAsync<string>("HelloWorld", "Magdeburg");
    }

当我从Microsoft官方示例中获取关于这种天蓝色函数级联的想法时,我不知道为什么未注册函数“ HelloWorld”。上传到Azure中后,该功能与该类中的所有其他功能一样在Azure门户中可见。

1 个答案:

答案 0 :(得分:1)

您的时间触发功能需要调用用耐用功能框架编写的启动功能。这是一个示例:

linuxfxf:
  sudo mkdir -p /usr/local/opt
  sudo chown -R $(whoami) /usr/local/opt