microsoft / vscode-apimanagement

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

APIM Dev Tier Returns 401 to VS Code Debug Session #318

Open ghost opened 1 year ago

ghost commented 1 year ago

APIM Dev Tier Returns 401 to VS Code Debug Session: It should allow VS Code to connect to a debug session on APIM API Operation

From client: launch({ "type": "apim-policy", "request": "launch", "name": "Attach to APIM", "stopOnEntry": true, "gatewayAddress": "wss://***/debug-0123456789abcdef", "managementAddress": "https://management.azure.com//subscriptions/*/resourceGroups/pic_apiman_dev_rg*/providers/microsoft.apimanagement/service/dev09-apim01-apiman", "subscriptionId": "2e260c77-daba-4540-9ae4-019a33db3331", "operationData": "GET https://*****/agencyapibridge/api/account HTTP/1.1\nOcp-Apim-Subscription-Key: ****\nOcp-Apim-Debug: **\nOcp-Apim-Trace: true\n", "fileName": "*****-agencyportalbridge-get-api-account.http", "__sessionId": "b87f5e7c-5726-47da-84f2-1463aa6158dc" }) 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 }

Does this occur consistently? Yes Repro steps:

  1. Open VS Code
  2. Log Into Azure with APIM Extension
  3. Right Click an API Operation
  4. It gives 401 error

Version: 0.11.4 OS: win32 OS Release: 10.0.19042 Product: Visual Studio Code Product Version: 1.78.2 Language: en

alexweininger commented 1 year ago

It might be better to file an issue on the API Management extension https://github.com/Microsoft/vscode-apimanagement