<i id='MhKXS'><tr id='MhKXS'><dt id='MhKXS'><q id='MhKXS'><span id='MhKXS'><b id='MhKXS'><form id='MhKXS'><ins id='MhKXS'></ins><ul id='MhKXS'></ul><sub id='MhKXS'></sub></form><legend id='MhKXS'></legend><bdo id='MhKXS'><pre id='MhKXS'><center id='MhKXS'></center></pre></bdo></b><th id='MhKXS'></th></span></q></dt></tr></i><div id='MhKXS'><tfoot id='MhKXS'></tfoot><dl id='MhKXS'><fieldset id='MhKXS'></fieldset></dl></div>
  • <legend id='MhKXS'><style id='MhKXS'><dir id='MhKXS'><q id='MhKXS'></q></dir></style></legend>

    <small id='MhKXS'></small><noframes id='MhKXS'>

      1. <tfoot id='MhKXS'></tfoot>
          <bdo id='MhKXS'></bdo><ul id='MhKXS'></ul>

        Azure Functions:如何在 WebStorm 中调试?

        Azure Functions: How to debug in WebStorm?(Azure Functions:如何在 WebStorm 中调试?)

            <tbody id='6wwfg'></tbody>
          <legend id='6wwfg'><style id='6wwfg'><dir id='6wwfg'><q id='6wwfg'></q></dir></style></legend>
              • <bdo id='6wwfg'></bdo><ul id='6wwfg'></ul>
                <i id='6wwfg'><tr id='6wwfg'><dt id='6wwfg'><q id='6wwfg'><span id='6wwfg'><b id='6wwfg'><form id='6wwfg'><ins id='6wwfg'></ins><ul id='6wwfg'></ul><sub id='6wwfg'></sub></form><legend id='6wwfg'></legend><bdo id='6wwfg'><pre id='6wwfg'><center id='6wwfg'></center></pre></bdo></b><th id='6wwfg'></th></span></q></dt></tr></i><div id='6wwfg'><tfoot id='6wwfg'></tfoot><dl id='6wwfg'><fieldset id='6wwfg'></fieldset></dl></div>

                <tfoot id='6wwfg'></tfoot>

                  <small id='6wwfg'></small><noframes id='6wwfg'>

                • 本文介绍了Azure Functions:如何在 WebStorm 中调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  azure-functions-cli 提供了一种启动调试的方法,但这些说明似乎是 Visual Studio 特定的.

                  我尝试使用与无服务器类似的技巧,方法是在 WebStorm 中设置运行配置以将 JavaScript 文件指向:

                  ode_modulesazure-functions-clilibmain.js

                  然后传递应用程序参数:

                  运行 myFunctionName --debug

                  这使用 Azure 的工具成功运行了这些功能,但是 WebStorm 都尝试设置调试端口;当 Azure 窗口打开时,它会设置自己的调试端口.

                  来自网络风暴:

                  C:Program Files (x86)JetBrainsWebStorm 2016.2.3in unnerw.exe" "C:Program Files odejs ode.exe" --debug-brk=60168 --expose_debug_as=v8debug C:UsersusernameAppDataRoaming pm ode_modulesazure-functions-clilibmain.js 运行 myfunction --debug调试器监听 [::]:60168System.Net.Http.HttpRequestException:发送请求时出错.--->System.Net.WebException:

                  同样,Azure-cli 说它打开了一个调试端口,但它们不匹配.

                  因此,调用函数时会忽略设置的断点(尽管它确实运行成功).

                  有谁知道如何正确配置它才能使用 WebStorm 进行调试?

                  解决方案

                  Azure-Functions-CLI 已重命名为 azure-functions-core-tools.如果您仍有 Azure-Functions-CLI,请参阅本文末尾的旧版回复.

                  如果您正在运行新的 azure-functions-core-tools,它们似乎破坏了运行远程调试器的能力 :-(.

                  我打开了以下问题,如果他们告诉我,我会更新:https://github.com/Azure/azure-functions-core-tools/issues/378

                  幸运的是,azure-functions-core 工具的新 Beta 版不具备所有这些 C# 疯狂功能,无法在其他操作系统上运行,并且需要远程调试器.要安装该版本,您可以使用:

                  npm i -g azure-functions-core-tools@core

                  安装该版本后,您可以使用良好的ol 标准 Node 运行时"启动内容.

                  1. 在 WebStorm 中从 Run -> Edit Configurations 创建一个新的Node.JS".
                  2. 为调试命名.
                  3. 将 JavaScript 文件设置为:~AppDataRoaming pm ode_modulesazure-functions-core-toolslibmain.js

                  注意:以上假设您在带有全局标志的 Windows 计算机上安装了 Azure Functions.

                  1. 将应用程序参数设置为:start --debug VSCODE

                  1. 编辑文件.vscodelaunch.json"并将节点的调试端口更改为9229.
                  2. 在 WebStorm 中选择 Run-> Debug:"What_You_Named_the_Remote_Profile"

                  3. 添加一些断点.

                  4. 导航到您的 API 端点并查看断点是否有效.

                  注意:默认情况下,函数显示在

                  注意:以上屏幕截图已根据最新版本的 Azure Functions CLI/进行了更新.早期版本要求您声明应用程序名称,并且不需要 --debug 进行调试.因此,如果您未更新到最新版本的 Azure Functions CLI(现在称为 Azure-Functions-Core-Tools),您可能需要在参数"字段中设置运行 MyApp".

                  1. 在 WebStorm 中选择 Run-> Debug:"What_You_Named_the_Remote_Profile"

                  2. 添加一些断点.

                  3. 导航到您的 API 端点并查看断点是否有效.

                  注意:默认情况下,函数显示在 http://localhost:7071/api/functionName

                  The azure-functions-cli offers a way to kickoff debugging, but these instructions seem to be Visual Studio specific.

                  I tried using a similar trick to serverless by setting up a run config in WebStorm to point the JavaScript file to:

                  ode_modulesazure-functions-clilibmain.js

                  And then passing the Application args:

                  run myFunctionName --debug

                  This successfully runs the functions with Azure's tools, but both WebStorm tries to set a debugging port; and when the Azure window opens up it sets its own debugging port.

                  From Webstorm:

                  C:Program Files (x86)JetBrainsWebStorm 2016.2.3in unnerw.exe" "C:Program Files odejs ode.exe" --debug-brk=60168 --expose_debug_as=v8debug C:UsersusernameAppDataRoaming pm ode_modulesazure-functions-clilibmain.js run myfunction --debug Debugger listening on [::]:60168 System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException:

                  Likewise, Azure-cli says it opens a debugging port, but they do not match.

                  As a result, breakpoints set are ignored when the functions are called (Though it does successfully run).

                  Anybody know how to configure this properly to be able to use WebStorm to debug?

                  解决方案

                  Azure-Functions-CLI was renamed to azure-functions-core-tools. If you still have the Azure-Functions-CLI see my legacy response at the end of this post.

                  If you're running the new azure-functions-core-tools it looks like they broke the capability to run a remote debugger :-(.

                  I have the following issue opened and I will update if they tell me otherwise: https://github.com/Azure/azure-functions-core-tools/issues/378

                  Fortunately, the new Beta version of the azure-functions-core tools doesn't have all of this C# craziness that prevents it from running on other OSes and requires a remote debugger. To install that version, you can use:

                  npm i -g azure-functions-core-tools@core
                  

                  With that version installed, you can launch things with the good 'ol standard Node runtime.

                  1. Within WebStorm from Run -> Edit Configurations create a new "Node.JS".
                  2. Give the debugging some type of name.
                  3. Set the JavaScript file to: ~AppDataRoaming pm ode_modulesazure-functions-core-toolslibmain.js

                  NOTE: The above assume you installed Azure Functions on a Windows machine with the global flag.

                  1. Set the Application Parameters to: start --debug VSCODE

                  1. Edit the file ".vscodelaunch.json" and change the debug port to 9229 for node.
                  2. Within WebStorm choose Run-> Debug:"What_You_Named_the_Remote_Profile"

                  3. Add some breakpoints.

                  4. Navigate to your API end-point and see that the break-points work.

                  NOTE: By default it appears the function will be at http://localhost:7071/api/functionName

                  ------------------- EDITED But Below Held for Posterity --------------

                  Okay, it looks like you can not do this with local debugging, but can with "Remote Debugging" within WebStorm.

                  1. Within WebStorm from Run -> Edit Configurations create a new "Node.JS Remote Debug".
                  2. Give the debugging some type of name.
                  3. Hit the + Sign where it says, "Before Launch: External Tool" and choose "Run External Tool".
                  4. Hit the + Sign again and fill it out like the screen-shot (This is assuming you installed the Azure Function CLI globally).

                  NOTE: The above screenshot has been updated based on the latest version of Azure Functions CLI/. Earlier versions required you to state an app name, and did not require --debug to debug. As a result if you are not updated to the latest version of Azure Functions CLI (now known as Azure-Functions-Core-Tools) you may need to have "run MyApp" in the Parameters field.

                  1. Within WebStorm choose Run-> Debug:"What_You_Named_the_Remote_Profile"

                  2. Add some breakpoints.

                  3. Navigate to your API end-point and see that the break-points work.

                  NOTE: By default it appears the function will be at http://localhost:7071/api/functionName

                  这篇关于Azure Functions:如何在 WebStorm 中调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  quot;Status Code:200 OK (from ServiceWorker)quot; in Chrome Network DevTools?(“状态码:200 OK(来自 ServiceWorker)在 Chrome 网络开发工具中?)
                  How to set a header for a HTTP GET request, and trigger file download?(如何为 HTTP GET 请求设置标头并触发文件下载?)
                  Adding custom HTTP headers using JavaScript(使用 JavaScript 添加自定义 HTTP 标头)
                  SQL Query DocumentDB in Azure Functions by an integer not working(通过整数在 Azure Functions 中 SQL 查询 DocumentDB 不起作用)
                  Azure Functions [JavaScript / Node.js] - HTTP call, good practices(Azure Functions [JavaScript/Node.js] - HTTP 调用,良好实践)
                  Azure Functions - Import Custom Node Module(Azure Functions - 导入自定义节点模块)
                      <tbody id='JfKv7'></tbody>
                      <bdo id='JfKv7'></bdo><ul id='JfKv7'></ul>

                          • <tfoot id='JfKv7'></tfoot>
                          • <legend id='JfKv7'><style id='JfKv7'><dir id='JfKv7'><q id='JfKv7'></q></dir></style></legend>
                          • <i id='JfKv7'><tr id='JfKv7'><dt id='JfKv7'><q id='JfKv7'><span id='JfKv7'><b id='JfKv7'><form id='JfKv7'><ins id='JfKv7'></ins><ul id='JfKv7'></ul><sub id='JfKv7'></sub></form><legend id='JfKv7'></legend><bdo id='JfKv7'><pre id='JfKv7'><center id='JfKv7'></center></pre></bdo></b><th id='JfKv7'></th></span></q></dt></tr></i><div id='JfKv7'><tfoot id='JfKv7'></tfoot><dl id='JfKv7'><fieldset id='JfKv7'></fieldset></dl></div>

                            <small id='JfKv7'></small><noframes id='JfKv7'>