“函数运行时无法启动”

时间:2018-10-04 18:10:10

标签: c# azure azure-functions azure-webjobs azure-functions-runtime

我知道它可能与配置错误有关,但不幸的是,我得到的最多信息是

  

函数运行时无法启动。会话ID:   b939c608ae424150878a55eeac6e7d36时间戳:2018-10-04T18:05:22.023Z

我的功能看起来像

    [FunctionName("DoJob")]
    public static async Task DoJobAsync([ServiceBusTrigger("job-queue", Connection = "MyServiceBusConnection")] string json, ILogger log)
    {

       … 

    }

我的local.settings.json就像

{
    "IsEncrypted": false,
    "Values": {
      "AzureWebJobsStorage": "UseDevelopmentStorage=true",
      "AzureWebJobsDashboard": "UseDevelopmentStorage=true",
      "MyServiceBusConnection": "[my service bus connection string]"
    }
}

该功能应用在本地构建并发布,但是一旦我在门户中导航到该应用,就会出现上述错误。

我正在使用.NET Standard(V2)和最新版本1.0.22。

此外,如果我尝试在门户中进行测试,则会收到500 Internal Server Error,但日志流中没有任何显示。

3 个答案:

答案 0 :(得分:7)

没有更多信息,我想您可能会忘记在Azure门户的“应用程序设置”中添加MyServiceBusConnection,这将导致您看到的相同错误。

如果不是这种情况,则可以转到https://<functionappname>.scm.azurewebsites.net/DebugConsole并导航到D:\home\LogFiles\Application\Functions\Host以查看函数运行时日志。

答案 1 :(得分:3)

URL对我不起作用,但是有一种简单的方法来获得相同的结果。转到Development Tools,然后转到Advanced Tools (Kudu)。从Debug console菜单中,选择CMD。浏览LogFiles,然后依次导航ApplicationFunctionsHost。然后检查日志文件。

答案 2 :(得分:0)

您可以在应用程序Insight中看到异常。

从Azure门户的“功能应用程序”页面中打开应用程序Insight:

enter image description here

在Insight内打开失败:

enter image description here

您可以在其中看到所有异常,并在每个异常中进行钻探。

相关问题