VS代码PowerShell Azure函数调试OmnishArp异常
我很难在VS代码中调试PowerShell功能。 VS代码:1.68.0 Azure核心工具:V4 PowerShell:7
启动。JSON
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to PowerShell Functions",
"type": "PowerShell",
"request": "attach",
"customPipeName": "AzureFunctionsPSWorker",
"runspaceId": 1,
"preLaunchTask": "func: host start"
}
]
}
和功能代码:
RUN.PS1
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a request."
# Interact with query parameters or the body of the request.
$name = $Request.Query.Name
if (-not $name) {
$name = $Request.Body.Name
}
$body = "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
if ($name) {
$body = "Hello, $name. This HTTP triggered function executed successfully."
}
# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Body = $body
})
此错误(请参见异常链接),一旦我击中F5,就会发生。尽管我可以看到主机启动任务正在启动,但是在此例外情况下,调试会中断,
请在这个问题上帮助我吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从我们的目的开始,在VS代码中调试Azure functions PowerShell时,请遇到相同的问题:
我已经尝试了不同的方案,但是调试不起作用:
我建议在快速分辨率。
From our end, getting the same issue when debugging the Azure Functions PowerShell in VS Code:
I have tried with different scenarios, but debugging didn't work:
I suggest raising the ticket as a bug in the GitHub Repo of Omnisharp-vscode for quick resolution.
看起来其他人上周对VSCODE-ASUREFUNCTIONS项目记录了一个问题,并且能够解决它:
https://github.com/microsoft/vscode-azurefunctions/issues/3184
Looks like someone else logged an issue against the vscode-azurefunctions project last week and was able to resolve it:
https://github.com/microsoft/vscode-azurefunctions/issues/3184