vscode-apimanagement icon indicating copy to clipboard operation
vscode-apimanagement copied to clipboard

Cannot read property 'primaryKey' of undefined error in VSCode

Open sairam-github opened this issue 4 years ago • 2 comments

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.<anonymous> extension.bundle.js:479:71359
fulfilled extension.bundle.js:479:68951
processTicksAndRejections task_queues.js:97:5

sairam-github avatar Jun 16 '21 11:06 sairam-github

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.

TechPrototyper avatar Feb 18 '23 19:02 TechPrototyper

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

fpdutra avatar May 31 '23 20:05 fpdutra