Azure函数: test locally in VS Code

标签 azure visual-studio-code azure-functions

我遵循了这个指南:https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-typescript?pivots=nodejs-model-v3#run-the-function-locally 在本地运行 Azure 函数。

所以,当我运行时: enter image description here

我在 VS Code 的右下角看到错误消息: enter image description here

并且无法查看详细的错误消息。

无法调试...我想知道是什么导致了这个 500 错误。

关于如何在 VS Code 中本地运行/测试/调试 Azure 函数有什么建议吗?

最佳答案

您可以按照以下步骤检查 Visual Studio Code 中的错误日志:

  1. 转到查看=>输出=>它将打开包含日志的输出窗口。

enter image description here

  • 在 Visual Studio Code 中打开命令面板(ctrl+shift+p),搜索 Developer:Show logs (或)Developer: Open Logs folder并选择。
  • enter image description here

    • 选择 Developer:Show logs 后,它将在输出窗口中显示日志:

    enter image description here

  • 您还可以运行 func host start --debug在 VScode 终端中,会显示错误详细信息:
  • enter image description here

    enter image description here

    关于Azure函数: test locally in VS Code,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76872392/

    相关文章:

    azure - 调用经过用户身份验证的 http 触发器时发生错误

    c# - 来自 Visual Studio 2017 的 Azure 函数调试连接出现 'N/A' 监听器连接错误

    c# - 如何在 Azure Functions Bot 中注册帮助/重置/设置可评分(非主动)?

    azure - 名称服务器 ns3-02.azure-dns.org。应该采用正确的格式

    c# - 系统参数异常 : Format of the initialization string does not conform to specification starting at index 197?

    asp.net-mvc - 将 Web 角色发布到 Azure 云服务时的代码优先迁移

    python - 使用 VSCode 使用 docker 卷调试 Docker 容器内的 Django 后端

    node.js - 如何在 VSCode 中像打开另一个编辑器选项卡一样打开浏览器

    powershell - 用于配置 Azure Web App 持续部署的脚本(网站)

    windows - Windows 上 Visual Studio Code 的 PlantUML 扩展仅适用于序列图