-
Notifications
You must be signed in to change notification settings - Fork 511
Cannot inspect variables or use debug commands in Azure Functions in terminal #3137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi. I've sent a .zip of the requested logs to [email protected]. |
FWIW, here's a screenshot from a virgin Windows 10 machine, running pwsh 7.1.1, latest pwsh extension and Core Tools running the default Azure Functions HTTP project with a breakpoint set. This VM is in a client environment completely separate from the macOS environment from which I first reported this problem. It's been, literally, years and years now that the PowerShell extension hasn't played nice with the VS Code debugger. I've reporting only a few of the issues I've experienced, all of which either were closed with pointed fingers elsewhere or were "wait for us to rearchitect." It makes one long for the ISE -- however limited it was, it was reliable. I just don't understand how PowerShell developers can be expected to depend on this extension, which is still labelled "preview" (and not to be confused with the "preview, preview" version of the extension). If I'm doing something wrong, I'd be happy to fix it -- providing it's documented. As it is, the paragraph or two on debugging a function in VS Code is embarrassingly thin. |
Thanks @yobyot for all the detailed information, we really appreciate it. Unfortunately, this will take more investigation on our part--thanks for your patience! |
Hello, pwshTeam. Any update on this issue? A workaround? Anything? It's so hard to write an Az Function using the command line debugger. Thanks. |
Can you confirm it's not working in the same manner with the latest release? We switched to use the Debug Adapter Protocol in February. On that note, the debugger is actually getting rewired (again, but it's necessary) as part of PowerShell/PowerShellEditorServices#1295 |
Confirmed. Exactly the same problem. |
Dang, well, we're actively fixing some threading issues in PowerShell/PowerShellEditorServices#1295 which will also change the underlying debugger implementation quite a bit, perhaps it'll be fixed then. |
Perhaps? Maybe? Possibly? That's not especially comforting -- especially when this Azure Functions PowerShell support is GA and debugging a function has never worked correctly. Isn't anyone at Microsoft embarrassed that one cannot accurately and conveniently debug PowerShell Azure Functions? (Even a local PowerShell script debug session isn't all that reliable, either.) Sorry to be a pain but the agony inflicted on PowerShell developers by never really completely replacing the ISE has gone on too long. |
We're working on it! |
Hello, is this problem being worked on as part of https://github.com/PowerShell/vscode-powershell/projects/9? |
Is there an update on this? |
@CallumCrowley the previously mentioned work has been long since merged and we've been stabilizing it. Can you please test the PowerShell Preview for VS Code and let me know if this is resolved? |
Preview extension didn’t work for me. |
Oh, oh, I see you are trying to use attach to runspace. This is almost fixed! @SeeminglyScience has been hard at work on it and PowerShell/PowerShellEditorServices#1752 is under review! |
@andschwa great! I'll give it a go 😊 |
Let's pause for a moment and remind ourselves that GA of Azure Functions support for PowerShell was announced in November of 2019. In the nearly three year since, nobody AFAIK has ever been able to use VS Code to write and debug a Function. Since the ISE is long dead, in essence that means nobody has been able to write a Function in PowerShell suitable for production deployment. Yes, I'm being critical of the PowerShell team here for their lack of understanding the requirements of production-quality code in their product and in the customers' environments. And, yes, they had every excuse in the book ready: we don't have people, this requires a re-write, and on and on. As a PowerShell fan, this is a tragedy. |
@yobyot good news! The latest preview 2022.4.1 when it releases should have fixed this finally. It was a very difficult bug to remediate. |
Preview? What I care about is GA code. My client that does not permit public preview tools or resources. |
@yobyot this latest preview is a release candidate, it's expected to make it to stable in the next few weeks! |
@yobyot things take time! Please be patient, there was a ton that went into fixing this, and it is fixed now. Please test the preview extension (if you cannot do so for work, test it in another environment). |
This issue has been marked as fixed. It has been automatically closed for housekeeping purposes. |
@JustinGrote @andschwa thanks for your work on this! 😄 |
It was @SeeminglyScience that fixed it! |
Issue Description
Debugging an Azure Function using the PowerShell extension for VS Code.
Attached Logs
Follow the instructions in the README about
capturing and sending logs.
Environment Information
Visual Studio Code
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
Problem description
I hope the two attached animations make the point: I cannot debug an Azure Function in VS Code. As you can see, it's possible to do so in pwsh consoles. If there's a setting that enables a regular debugging session in VS Code, I can't find it so I am reporting this as a bug. I hope it's a user error (caused by pitiful doc) and not one of those "You just can't do it in VS Code" issues that seem to plague the PowerShell environment in VS Code.
Debugging in a pair of consoles (works):
Debugging in VS Code (no input possible):
The text was updated successfully, but these errors were encountered: