Using .NET Core on a Mac with Visual Studio Code, I'm trying to host an Azure Function locally, and attach the debugger to it.
Manually, I can get it to work by starting the function with func host start
, followed by pressing the debug button in the IDE, which runs the default launch.json file. This let's me pick a process to attach the debugger to because of the line "processId": "${command:pickProcess}"
.
I would like to automize this flow, triggering it with a simple click on the debug button in VSCode.
In the above picture I attempt to solve this by running a preLaunchTask
before attaching the debugger. This task should host and start the function - which it does so successfully when isolated from the flow.
However, when I hit the Debug button with the above configuration, VSCode lets me pick a process immediately before actually having completed the preLaunchTask
and so the process func
is not yet available.
Is my line of thinking in order? What could I be missing in order for this to work?