简体   繁体   English

“函数运行时无法启动”

[英]"The function runtime is unable to start"

I know it probably has something to do with a misconfiguration, but unfortunately the most info I get is我知道这可能与配置错误有关,但不幸的是我得到的最多信息是

The function runtime is unable to start.函数运行时无法启动。 Session Id: b939c608ae424150878a55eeac6e7d36 Timestamp: 2018-10-04T18:05:22.023Z会话 ID:b939c608ae424150878a55eeac6e7d36 时间戳:2018-10-04T18:05:22.023Z

My function looks like我的功能看起来像

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

       … 

    }

and my my local.settings.json is like我的 local.settings.json 就像

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

The function app builds locally and publishes, but as soon as I navigate to it in the portal I get the above error.函数应用程序在本地构建并发布,但是一旦我在门户中导航到它,我就会收到上述错误。

I am using .NET Standard (V2) and the latest version 1.0.22.我正在使用 .NET Standard (V2) 和最新版本 1.0.22。

Also, if I try to test in the portal I get 500 Internal Server Error but nothing shows up in Log Streaming.此外,如果我尝试在门户中进行测试,我会收到 500 内部服务器错误,但日志流中没有显示任何内容。

Without any further info, I assume you may forget to add MyServiceBusConnection in Application settings on Azure portal, which will cause same error you have seen.如果没有任何进一步的信息,我假设您可能忘记在 Azure 门户的应用程序设置中添加MyServiceBusConnection ,这将导致您看到的相同错误。

If it's not the case, you could go to https://<functionappname>.scm.azurewebsites.net/DebugConsole and navigate to D:\\home\\LogFiles\\Application\\Functions\\Host to see function runtime logs.如果不是这种情况,您可以转到https://<functionappname>.scm.azurewebsites.net/DebugConsole并导航到D:\\home\\LogFiles\\Application\\Functions\\Host以查看函数运行时日志。

The URL does not work for me, but there is an easy way to get the same results.该 URL 对我不起作用,但有一种简单的方法可以获得相同的结果。 Go to Development Tools then Advanced Tools (Kudu) .转到Development Tools然后转到Advanced Tools (Kudu) From the Debug console menu, choose CMD .Debug console菜单中,选择CMD Navigate LogFiles , then Application , then Functions , then Host .依次导航LogFilesApplicationFunctionsHost Then examine the log files.然后检查日志文件。

You can see the exception in the application Insight.您可以在应用程序 Insight 中看到异常。

Open the application Insight from the 'Function Apps' page in the Azure portal:从 Azure 门户的“功能应用”页面打开应用程序 Insight:

在此处输入图片说明

Inside the Insight open the Failures:在洞察中打开失败:

在此处输入图片说明

You can see there all the exceptions, and drill inside each one of them.您可以在那里看到所有异常,并深入了解每个异常。

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

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