Can't use extension when minimum api version is enforced
Does this occur consistently? Yes
- 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)
- Set "Enforce minimum API version" = true (wait for Apim to update ...)
- Retest - expect you to see the issue.
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.<anonymous> extension.bundle.js:16:392980
rejected extension.bundle.js:16:392126
It seems like the extension is using the old version of the management API.
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/[email protected] 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.
+1 same issue for us.
Hitting the same issue on three of our four APIMs.
Seeing "Error: 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-05-01-preview,2023-09-01-preview,2024-06-01-preview. Example query param format: api-version=SupportedVersion.