Not able to debug Azure Functions in Visual Studio Code

Viewed 2485

I am trying to do this tutorial to run azure function app using vs code.

I am able to run it locally, but not debug it.

run function app locally using visual studio

When I browse to http://localhost:7071/api/category, I am getting the response.

But I place a breakpoint(see the above image on line 11), it is supposed to stop, but does not.

I see a difference in the image shown here in the docs with mine.

debugging azure function apps in visual studio code

Contrast to that, I see a square in my case (see below). Does this make a difference?

debugging azure function apps in visual studio code

Update

Azure Function core tools are already installed. Still the problem

Azure Function Core tools.

Update 2

Its probably the version of Azure Function Core Tools

At least with C# Azure Functions, when ever I have 4.x, I am able to debug.

This morning I started with this tutorial. And if you scroll down a bit, its clearly mentioned 4.x here

I downloaded 4.x and well as 3.x installers, installed, uninstalled, and then re-installed and checked. I see that, at least with C#, I am able to debug with 4.x. But with javascript, I still facing some issues.

Multiple Version of Azure Functions Core Tools

The article here tells us to install Azure Functions Core Tools V3. This could probably wrong and must be revisited.

I just saw here, with JavaScript, its further complicated by the Node js version on my machine. In here, it says Node.js 10.14.1+, while on my machine, its v14.17.3 while the LTS is at v16.

2 Answers

To debug your typescript function code in Visual studio code, you have to install azure function core tools package.

  1. Try installing the above package from VS Code. Press Ctrl+Shift+p in your VS Code > Type Azure Functions Core Tools and Install/Update them.

enter image description here

  1. After installing this, restart your VS Code and run the debugging. If you get any errors while installing, then try to install manually by downloading from the web.

Then after download and installing the azure function core tools v3 version, restart your VS code and now try run the debugging of your application.

  1. It will give you the function URL in the console.
  2. Paste that URL in the browser and pass the parameter. While giving the output, it hits the breakpoint if you keep the breakpoint at response context like below:

enter image description here

try to add : "justMyCode": false
in your launch.json file
worked for me
launch.json

Related