TimerTrigger 没有触发函数

TimerTrigger is not firing the function

我有一个 Azure Durable Function (v3),我计划在周六 20:30(晚上 8:30)运行。周日早上,我看到它没有 运行,所以我将它安排在周一的 运行 20:30。我通过部署新的 zip 包和新的 TimerTrigger 设置来做到这一点。该应用程序在星期一 运行,但它没有执行我希望它执行的所有工作。在星期三 13:00 左右,我添加了一些日志记录并将应用程序安排在 运行 每天 20:30:

public async Task Start([TimerTrigger("0 30 20 * * *")] TimerInfo timerInfo,
            [DurableClient] IDurableOrchestrationClient starter,
            ILogger log)
        {
// ...
        }

我今天(星期四早上)检查了,功能没有触发。我在 Azure 存储上打开日志,但我只看到星期一的 运行:

2021-04-19T20:30:00.058 [Information] Executing 'KreptdIntegration_Start' (Reason='Timer fired at 2021-04-19T20:30:00.0215809+00:00', Id=8c40e15b-a740-4956-a6e6-b90b8fe95f3a)
2021-04-19T20:30:00.338 [Information] Started orchestration with ID = 'kreptdintegrationsingleinstance'.
2021-04-19T20:30:00.364 [Information] Executed 'KreptdIntegration_Start' (Succeeded, Id=8c40e15b-a740-4956-a6e6-b90b8fe95f3a, Duration=331ms)

在 Azure 门户功能的监控部分,我也只看到有关 运行 星期一的信息:

为什么函数没有触发?有没有可能我把这个功能安排得太晚了? (我安排在同一天 20:30 13:00 到 运行 左右。如果它是用 C# 编写并作为包部署的函数,是否可以从 Azure 门户手动触发该函数?

为确保新触发器正常工作,需要对其进行同步。您可以通过以下三种方式之一同步触发器:

  • 在 Azure 门户中重新启动函数应用
  • 使用主密钥向 https://{functionappname}.azurewebsites.net/admin/host/synctriggers?code=<API_KEY> 发送 HTTP POST 请求。
  • https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/Microsoft.Web/sites/<FUNCTION_APP_NAME>/syncfunctiontriggers?api-version=2016-08-01 发送 HTTP POST 请求。

将占位符替换为你的订阅 ID、资源组名称和函数应用的名称。

来源:https://docs.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies#trigger-syncing