简体   繁体   English

计时器触发Azure功能未被触发

[英]Timer triggered Azure Function not getting triggered

I have a function on Azure with the follow function.json file: 我在Azure上有一个函数,其中包含以下function.json文件:

{
    "bindings": [
        {
            "type": "timerTrigger",
            "direction": "in",
            "schedule": "0 0 3 * * *",
            "name": "myTimer"
        }
    ],
    "disabled": false
}

Unless I'm wrong, this should make the function run once a day, at 3AM ? 除非我错了,这应该让函数每天运行一次,凌晨3点?

This is the signature of the function: 这是该功能的签名:

public static async Task Run(TimerInfo myTimer, TraceWriter log) {}

So what is it I'm doing wrong? 那么我做错了什么? The function works fine when I manually trigger it (clicking "Run" in the portal), but it didn't run at 3AM this morning, and it didn't yesterday either. 当我手动触发它时(单击门户中的“运行”),该功能正常工作,但它今天凌晨3点没有运行,而且昨天也没有。

Edit: So, as suggested, I've changed the plan to a paid plan, and I've selected a dynamic plan. 编辑:因此,正如建议的那样,我已将计划更改为付费计划,并且我已选择了动态计划。 The logs still says nothing about the function getting activated at 3AM this morning. 日志仍然没有说明今天凌晨3点被激活的功能。

在此输入图像描述

Apps that run in Classic mode require 'Always On' to be enabled. 在经典模式下运行的应用程序需要启用“始终开启”。 Double-check that this is enabled -- that would explain it. 仔细检查这是否已启用 - 这可以解释它。

There are two plans that Functions apps can run in: Dynamic and Classic . 功能应用程序可以运行两种计划: 动态经典 You choose the plan during app creation. 您在应用创建期间选择计划。 There's currently no way to switch plans after the app has been created: 在创建应用程序后,目前无法切换计划:

在此输入图像描述

  • Classic Plans run on App Service plans just like other App Service apps. 与其他App Service应用程序一样, 经典计划在App Service计划上运行。 You can choose from Free, Basic, Standard, etc, and you control the scale yourself. 您可以选择免费,基本,标准等,您可以自己控制比例。 If you are using a Classic Plan, you must turn on 'Always On' in order to have triggers fire reliably. 如果您使用的是经典计划,则必须打开“始终打开”才能使触发器可靠地触发。 This requires your site to be in Basic or Standard mode. 这要求您的网站处于基本或标准模式。 You can manage this from your Function App (and check for 'Always On') by clicking 'Function app settings' -> 'Go to App Service Settings'. 您可以通过单击“功能应用程序设置” - >“转到应用程序服务设置”,从功能应用程序(并检查“始终打开”)进行管理。 The 'Always On' setting lives in 'Application settings'. “始终开启”设置位于“应用程序设置”中。

  • Dynamic Plans are charged by execution. 动态计划由执行收取。 There's no concept of 'Always On' -- when a trigger fires, your site will be started (if it's not already) and your function will run. 没有“永远在线”的概念 - 当触发器触发时,您的站点将启动(如果尚未启动)并且您的功能将运行。

See here for more details: https://azure.microsoft.com/en-us/documentation/articles/functions-scale/#choose-a-service-plan 有关详细信息,请参见此处: https//azure.microsoft.com/en-us/documentation/articles/functions-scale/#choose-a-service-plan

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM