-
Notifications
You must be signed in to change notification settings - Fork 137
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
Host auto-restart on save closes debug session #781
Comments
This is being tracked in the functions host: Azure/azure-functions-host#3543 |
It's not super clear to me from reading the bugs in azure-functions-host, but I think there is a difference in behavior in vscode somehow. I'm working on Python functions, and as this bug and the attached external bug says, when I change one of my function files the session ends. However I can run the same command in a terminal (in this case bash in WSL): ( When I do that, if I update a function file, the func command auto restarts correctly. So as far as I can tell the function tools are operating correctly (at least for me, with Python) but the extension isn't behaving correctly when the host restarts. Another thing about the current behavior. It looks like what's happening when a debug session is intered is pip install is run, and then in a new terminal the func command is run. In addition to this method not handling the restart correctly, the new terminal goes away when the func command restarts (and this may be the root of the issue), which means all the output from func goes away as well. I discovered this because my function was writing files into the function directory (not knowing this would restart the function host) but to me it just looked like my code had made the function host crash. it wasn't until I ran it outside of vscode that I saw that my file changes were causing the restart. |
@FISHMANPET there's definitely differences in behavior for VS Code. Here's what we do:
If I run
Full logs
This leads me to believe we still need the func cli to fix the above linked issue to get this to work fully. |
Could be related: microsoft/vscode#40917 |
Do we have any idea when this will be worked on? from a developer's perspective this makes having in type of serious flow impossible. EDIT for those that come across this issue while you can't debug if you run |
I would also like an ETA please, like @osbornm. For me, workflow with AzFunc is unbearable. Thank you for all your hard work, devs! |
No ETA from VS Code's side. Still blocked on Azure/azure-functions-host#3543 For more details, you can set "azureFunctions.stopFuncTaskPostDebug" to "false", which will prevent the logs from disappearing after you do a file change. You can see that the func cli is running into problems attempting to restart and eventually just stops itself.
With that in mind, not much we can do other than bother the Functions team. Per this comment seems like they're aware of the problem and have looked into it, but it's not an easy thing to fix. |
For anyone still trying to get this work on Mac, I got it to work using the "restart" property in the task and with the following arguments:
Launch.json {
"name": "Debug Azure Functions API",
"type": "node",
"request": "attach",
"port": 9229,
"restart": true
} |
Hey, bumping this as I'd love to see this getting solved |
Is there any update on this? |
Hey, this issue is better covered at Azure/azure-functions-core-tools#1239. With this solution being the current prime workaround. My team has been using it for a while now and it's a huge time-saver and seems stable 90% of the time. |
Feature Request:
The azure functions host will automatically detect file changes and reload. This is nice for javascript where you can make a quick edit in code and have host pick it up right away. However in VS Code the debug session terminates somewhere in this process. Not a huge deal but would be nice if the file watch and host restart could maintain a debug session. May include an ask on restart behavior for azure/azure-functions-core-tools
Extension version: 0.12.0
VS Code version: Code - Insiders 1.29.0-insider (d43f6cb9947c57a3254b556e69aeacc2b2025184, 2018-11-02T15:50:03.156Z)
OS version: Darwin x64 18.2.0
The text was updated successfully, but these errors were encountered: