microsoft / vscode-apimanagement

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

Cannot read property 'primaryKey' of undefined error in VSCode #218

Open sairam-github opened 3 years ago

sairam-github commented 3 years ago

Does this occur consistently? Repro steps:

  1. Open VSCode editor
  2. Find the API and operation to debug
  3. Right-click on the operation and select Start policy debugging

Action: azureApiManagement.debugPolicy Error type: TypeError Error Message: Cannot read property 'primaryKey' of undefined

Version: 1.0.2 OS: win32 OS Release: 10.0.18363 Product: Visual Studio Code Product Version: 1.55.2 Language: en

Call Stack ``` extension.bundle.js:479:71396extension.bundle.js:479:71396 OperationConsole. extension.bundle.js:479:71359 fulfilled extension.bundle.js:479:68951 processTicksAndRejections task_queues.js:97:5 ```
TechPrototyper commented 1 year ago

Sairam, did you ever find out what happened here? I have the same issue. Interesting, I have the same API on two APIM instances. In one instances, the error occurs, in the other instance, the debugging starts fine. So I wonder whether it has to do with the APIM Instance configuration?

Or, in other words, to solve this for the instance, move the API to a new APIM instance and try again.

fpdutra commented 1 year ago

You can solve this by running this on AZ CLI: az apim update --name API Management Name -g Resource Group --set apiVersionConstraint.minApiVersion=2019-01-01