microsoft / vscode-apimanagement

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

Cannot debug policy due to missing TTP debugger #295

Closed darren-kay closed 1 year ago

darren-kay commented 1 year ago

Following instructions here: https://learn.microsoft.com/en-us/azure/api-management/api-management-debug-policies

VS Code Version: 1.76.2 (system setup) Azure API Management v1.0.5 extension REST Client v0.25.1 by Huachao Mao extension

I right-click a policy and select "Start Policy Debugging" It opens the debug sidebar

image

It opens the command bar showing debuggers

image

In the DEBUG CONSOLE, the following messages are logged:

To client: {"seq":0,"type":"event","event":"output","body":{"category":"stderr","output":"Can't connect to gateway: Unexpected server response: 401."}} Can't connect to gateway: Unexpected server response: 401. To client: {"seq":0,"type":"event","event":"terminated"} From client: disconnect({"restart":false}) To client: {"seq":0,"type":"response","request_seq":3,"command":"disconnect","success":true}

I cannot find any information on why it would return 401 when I can edit the policy on the gateway.

darren-kay commented 1 year ago

I had enabled tracing for "Built-in all-access subscription" but it auto expired after an hour.

Re-enabled tracing then refresh in extension allowed it to work!