microsoft / vscode-apimanagement

VS Code extension for Azure API Management.
MIT License
59 stars 38 forks source link

Can't use extension when minimum api version is enforced #343

Open JamesOaDatacom opened 6 months ago

JamesOaDatacom commented 6 months ago

Does this occur consistently? Yes

  1. Create an APIM instance in the portal - but default, under Managment API blade, on the Managment API settings tab, "Enforce minimum API version" is false. At this point the extension is working correctly (can edit policy etc)
  2. Set "Enforce minimum API version" = true (wait for Apim to update ...)
  3. Retest - expect you to see the issue.

image

Action: azureApiManagement.showApiPolicy Error type: Error Error Message: API version query parameter is not specified or was specified incorrectly. Supported versions: 2021-08-01,2021-12-01-preview,2022-04-01-preview,2022-08-01,2022-09-01-preview,2023-03-01-preview,2023-05-01-preview,2023-09-01-preview Example query param format: api-version=SupportedVersion

Version: 1.0.8 OS: win32 OS Release: 10.0.22631 Product: Visual Studio Code Product Version: 1.85.1 Language: en

Call Stack ``` ApiPolicyEditor. extension.bundle.js:16:392980 rejected extension.bundle.js:16:392126 ```
verschaevesiebe commented 6 months ago

It seems like the extension is using the old version of the management API.

dozer75 commented 4 months ago

I got the same issue (originally reported it in #345 before I saw this issue) and after lots of struggle getting the source code up and running locally I realize that this project is so old and not updated so it uses old @azure/arm-apimanagement package that simply doesn't support higher versions than 2019-12-01 (that's hardcoded in the @azure/arm-apimanagement@6.0.0 which is in use). In addition to the hardcoding there, it's also hardcoded in the sources of this project as well.

So both needs to be fixed, but since 6.0.0 and to current version of the @azure/arm-apimanagement package there is a lot of breaking changes that needs to be dealt with, so it is a bigger job to fix than just simply change the apimApiVersion in constants.ts since dependencies needs to be updated.

So, simply put: This plugin does NOT until it is fixed support API Management Services that is configured using the recommended best practices.

carloraudino commented 3 months ago

+1 same issue for us.