在Node.js Azure函数中调试节点模块 [英] Debugging node module in node.js Azure Function

查看:72
本文介绍了在Node.js Azure函数中调试节点模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力调试用Java语言编写的无提示失败的Azure函数.

I am struggling to debug a silently failing Azure Function written in Javascript.

在本地,此功能可以正常工作(通过func cli).

Locally this works as expected (through func cli) without issue.

将其发布到Azure并运行npm install之后,执行函数(Httptrigger),我从下面等待的方法中得到零输出:

As soon as this is published to Azure, and after running npm install, executing the function (Httptrigger) I get zero output from the method that is being awaited below:

第一个和最后一个context.log调用均执行,我可以看到它们的消息已写入日志流控制台.

Both the first and last context.log calls execute and I can see their messages written to the log streaming console.

我对AF上的节点还很陌生,并且真的在调试方面苦苦挣扎-其他人如何调试他们的javascript函数?

I'm pretty new to node on AF, and really struggling with the debugging aspect - how do other people debug their javascript functions?

我几乎可以肯定该模块正在出错,或者向控制台发出警告-但似乎在Javascript功能中非常缺乏控制台支持.

I'm almost certain that the module is erroring, or writing warnings to console - but seems that console support is very much lacking in Functions for Javascript.

我尝试在Visual Studio 2017中进行远程调试-这无法下载符号(这是有道理的,因为它尚未编译).

I've tried remote debugging in Visual Studio 2017 - this fails to download symbols (which makes sense, because it's not compiled).

有什么想法的人吗?

推荐答案

不幸的是,到目前为止,还没有办法远程调试JS函数.但是,如果您使用的是Function v2,则可以看到所有 console.log/error/warn/info 消息,因为它们是由Application Insights捕获的,如上所述 这里.

Unfortunately, there is no way to debug JS functions remotely as of today. But if you are using Functions v2, you can see all console.log/error/warn/info messages since they are captured by Application Insights as mentioned here.

您可以在函数的应用数据洞察资源(如下所示)中搜索 Host.Function.Console ,以查看该函数创建的任何日志.

You can search for Host.Function.Console in your function's app insights resource, like below, to see any logs being made by your function.


这篇关于在Node.js Azure函数中调试节点模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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