如何解决/修复 Azure Function 主机崩溃? [英] How to troubleshoot/fix Azure Function host crashing?

查看:55
本文介绍了如何解决/修复 Azure Function 主机崩溃?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure 门户显示我的 azure 功能已启动并正在运行,但是当我通过浏览器导航到 https://{functionapp-name}.azurewebsites.net 时,我得到了

Azure portal displays that my azure function is up and running, but when I navigate to https://{functionapp-name}.azurewebsites.net via browser I'm getting

功能主机未运行."

但我确实可以通过观察看到有时发生的处理

But I definetly can see that processing happening sometimes by observing

{functionapp-name}/LogFiles/Application/Functions/Host/*.log 文件.

有什么解决此问题的建议吗?

Any suggestions on troubleshooting this?

推荐答案

重启Function app后检查Function host is not running是否一致.并确保我们检查了最新的日志.

Check whether Function host is not running is consistent after restarting Function app. And make sure we checked the latest logs.

基本上,如果我们的函数主机无法启动,我们可以在主机日志中看到详细信息,除非修复错误,否则函数不会处理.

Basically if our function host fails to start, we can see details in Host log and functions won't process unless error is fixed.

对于一个成功启动的函数主机,我们可以看到类似

For a successfully started function host, we can see logs like

Host initialized
Host started
Job host started
Host lock lease acquired by instance ID 'xx'.

如果我们得到的只是那些没有错误的令人愉快的信息,并且功能按预期触发,那就没什么可担心的了.

If those pleasant information without error is all we got, and functions are triggered as expected, there's nothing to worry about.

一旦出现一些错误(例如在 host.jsonproxies.json settings) 停止主机启动,错误如下所示.按照官方的样例尝试修复即可.

Once there're some mistakes(e.g. in host.json and proxies.json settings) stop host starting, error is shown as below. Just try to fix according to official samples.

A host error has occurred
xxx //some error details
Stopping JobHost
Job host stopped

这篇关于如何解决/修复 Azure Function 主机崩溃?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆