使用 vscode 调试 Azure Function

发布于 2025-01-09 17:25:35 字数 1301 浏览 1 评论 0原文

我一直在努力使用 vscode 调试 HttpTrigger 类型的 azure 函数。

我的假设是,问题可能与 .vscode/ 中的配置文件有关,或者最坏的情况是与我自己的环境有关。

截至目前,当我尝试调试最近创建的函数(func init)时,我从 vscode 收到以下错误:

> Executing task: dotnet clean /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary <

execvp(3) failed.: Permission denied

The terminal process "dotnet 'clean', '/property:GenerateFullPaths=true', '/consoleloggerparameters:NoSummary'" failed to launch (exit code: 1)

Inside .vscode/ There 4 files:

    ├── extensions.json
    ├── launch.json
    ├── settings.json
    └── tasks.json

and inside task.json There are some dotnet导致上述错误的相关命令。

尽管这些文件是由核心工具 (func) 自动生成的,但我从 task.json 中删除了 dotnet 行并点击“调试”。

几秒钟后我得到:

Failed to detect running Functions host within "60" seconds. You may want to adjust the "azureFunctions.pickProcessTimeout" setting. 

是否有任何命令可以自动生成调试配置?例如 “.NET 生成用于构建和调试的资产”

您是否遇到过类似的情况?


我的环境设置:

OS: Ubuntu 20.04.4 LTS
Code:1.64.2 x64
Azure Functions Extension: v1.6.0
Core Tools Version: 3.0.3904

I've been struggling to debug an HttpTrigger type azure function with vscode.

My assumption is that the issue might be related to the config files within .vscode/ or at worst, my own environment.

As of now, when I try to debug a recently created function (func init) I get the following error from vscode:

> Executing task: dotnet clean /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary <

execvp(3) failed.: Permission denied

The terminal process "dotnet 'clean', '/property:GenerateFullPaths=true', '/consoleloggerparameters:NoSummary'" failed to launch (exit code: 1)

Inside .vscode/ there 4 files:


    ├── extensions.json
    ├── launch.json
    ├── settings.json
    └── tasks.json

and inside task.json there are a few dotnet related commands that are causing the error above.

Despite these files being automatically generated by core tools (func) I removed the dotnet lines from task.json and hit Debug.

After a few seconds I get:

Failed to detect running Functions host within "60" seconds. You may want to adjust the "azureFunctions.pickProcessTimeout" setting. 

Is there any command to automatically generate the debug configuration? e.g. ".NET generate assets for build and debug"

Have you faced anything similar to it?


My env settings:

OS: Ubuntu 20.04.4 LTS
Code:1.64.2 x64
Azure Functions Extension: v1.6.0
Core Tools Version: 3.0.3904

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

圈圈圆圆圈圈 2025-01-16 17:25:35

tasks.json 中的 typeprocess 替换为 shell 解决了这个问题。

输入图片此处描述

Replacing the type from process to shell inside tasks.json solved it.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文