Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Azure函数无法从设置加载CRON计时器_C#_Azure_Azure Functions - Fatal编程技术网

C# Azure函数无法从设置加载CRON计时器

C# Azure函数无法从设置加载CRON计时器,c#,azure,azure-functions,C#,Azure,Azure Functions,我有一个用C#编写的Azure函数,并直接从VisualStudio使用Zip部署作为预编译进行部署。虽然在本地,一切都可以工作,但函数在启动时会抛出一个错误 函数(RunStatsRecomulation)错误:Microsoft.Azure.WebJobs.Host:错误索引方法“RunStatsRecomulation”。Microsoft.Azure.WebJobs.Host:“%TimerInterval%”未解析为值 计时器设置的CRON表达式存储在值为“0***”的键TimerIn

我有一个用C#编写的Azure函数,并直接从VisualStudio使用Zip部署作为预编译进行部署。虽然在本地,一切都可以工作,但函数在启动时会抛出一个错误

函数(RunStatsRecomulation)错误:Microsoft.Azure.WebJobs.Host:错误索引方法“RunStatsRecomulation”。Microsoft.Azure.WebJobs.Host:“%TimerInterval%”未解析为值

计时器设置的CRON表达式存储在值为“0***”的键TimerInterval下的设置中

该函数定义如下

    [FunctionName("RunStatsRecalculation")]
    public static async Task Run(
        [TimerTrigger("%TimerInterval%")]TimerInfo myTimer,
        ILogger logger,
        ExecutionContext context,
        CancellationToken ct)
    {

你知道什么地方出了问题吗?

我可以重新给你发帖。要解决此问题,请将密钥(TimerInterval)和值(0***)添加到azure函数应用程序设置

这是我的密码:

        [FunctionName("Function1")]
        public static void Run([TimerTrigger("%TimerSchedule%")]TimerInfo myTimer, ILogger log)
        {
            log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
            log.LogInformation($"this is a test for timer trigger...");
        }
和应用程序设置:


非常感谢!我把它添加到了错误的设置中。现在效果很好。