相关疑难解决方法(0)

函数侦听器无法启动。Azure 函数应用时间触发器

当我在本地环境中从 Visual Studio 运行 azure 函数时出现以下错误:

函数“Function1”的侦听器无法启动。Microsoft.WindowsAzure.Storage:错误请求。

这是我的代码

using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Extensions.Logging;

namespace FunctionApp3
{
    public static class Function1
    {
        [FunctionName("Function1")]
        public static void Run([TimerTrigger("0 */1 * * * *")]TimerInfo myTimer, ILogger log)
        {
            log.LogInformation($"C# Timer trigger function executed at: {DateTime.Now}");
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

配置(即local.settings.json)

{
    "IsEncrypted": false,
    "Values": {
        "AzureWebJobsStorage": "UseDevelopmentStorage=true",
        "FUNCTIONS_WORKER_RUNTIME": "dotnet"
    }
}
Run Code Online (Sandbox Code Playgroud)

但是当我设置一个 http 触发功能应用程序时,它工作正常。

c# azure-functions

4
推荐指数
2
解决办法
4337
查看次数

标签 统计

azure-functions ×1

c# ×1