简体   繁体   中英

Breakpoints not active in VS Code Node.js Remote Debugging on Azure App Service

I've followed the process in this article https://code.visualstudio.com/docs/azure/remote-debugging

While a debug session seems to have started, I cannot set or use any breakpoints.

Node.js in an App Service

I can stream logs. I tried to set a breakpoint on the files that show up in the Azure Explorer as well as the files that I work on. I keep getting an Unbound breakpoint

Created Node JS App and deployed to Azure Linux App Service .

  • Followed the same steps from the provided document to Enable Remote Debugging .

在此处输入图像描述

  • Even I got the same Unbound breakpoint message.

在此处输入图像描述

  • In Azure Portal => App Service => Configuration =>check Remote debugging Under Debugging section.

在此处输入图像描述

  • To cross check that I have changed the Runtime stack to .NET and tried to Enable Remote debugging from VSCode .Got the below error.

在此处输入图像描述

  • It clearly says that Remote Debugging option is available for NodeJS Azure Linux App .

  • Again, updated the Runtime stack back to NODE .

Thanks @Kenneth for the configuration steps.

Tried to change few configurations as mentioned in the Document.

In VSCode => File => Preferences => Settings =>In search box search with appservice keyword.

在此处输入图像描述

We will get an option to edit settings.json file.

在此处输入图像描述

  • In settings.json , add the below line of code
"appService.enableRemoteDebugging":true
  • In Package.json change the scripts setting as below.
"scripts": {
"start": "node ./bin/www",
"start\\_azure\\_debug": "node --inspect=0.0.0.0:$APPSVC\\_TUNNEL\\_PORT index.js"
},
  • In Azure Portal => Your Azure App Service => Configuration => General settings , add the npm run start_azure_debug as startup command.

在此处输入图像描述

  • Now try to debug from VSCode .
  • Getting Timeout Exception.在此处输入图像描述

There might be some issue with Remote Debugging , MS Support request may be required.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM