microsoft / vscode-apimanagement

VS Code extension for Azure API Management.
MIT License
60 stars 40 forks source link

Unable to Remotely Debug APIM Policies with VS Code and APIM Extension #165

Closed marcami closed 3 years ago

marcami commented 3 years ago

I followed the instructions at the link below to debug my APIM policies with VS Code 1.53.2 and APIM Extension 0.1.8 on Windows x64 10.0.19042, but the the APIM Extension did not automatically open a new editor window after establishing the debugging session via the "Start Policy Debugging" context menu. So I manually opened a new editor wiindow and sent an HTTP request to my API. Although a successful response was received, the APIM Extension did not open a debug window showing that it had entered my policy, nor did it stop at any breakpoints.

https://docs.microsoft.com/en-us/azure/api-management/api-management-debug-policies

Previous to installing VS Code 1.53.2, this APIM policy debugging feature was working for me. My launch.json file looks like this:

{ "version": "0.2.0", "configurations": [ { "type": "apim-policy", "request": "launch", "name": "Attach to APIM", "stopOnEntry": true } ] }

RupengLiu commented 3 years ago

@marcami Can I know the skuType of the instance?

marcami commented 3 years ago

@RupengLiu Developer

RupengLiu commented 3 years ago

@marcami while you are writing the HTTP Request file, did you add the Ocp-Apim-Debug header like the example below: image

marcami commented 3 years ago

I added the Ocp-Apim-Debug header, and I get the Ocp-Apim-Trace-Location in my response. However, I am not breaking on entry into my APIM policy.

RupengLiu commented 3 years ago

Week ago, there was an regression from the backend that breaks the debugging feature. I fixed it and reupload the vscode extension (same version) to the marketplace, can you try uninstall and install again

marcami commented 3 years ago

I uninstalled v0.1.8 of the APIM extension and re-installed it, but I still get the same behavior.

marcami commented 3 years ago

Thx! This fixes my issue.