microsoft / vscode-apimanagement

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

Cannot view APIs in the extension in Visual Studio Code. #345

Closed dozer75 closed 4 months ago

dozer75 commented 4 months ago

Does this occur consistently? Yes Repro steps:

  1. Installed a API Management using the following Bicep script:
    
    param name string

param appiId string param appiConnectionString string param appiName string param hostname string param managedIdentityId string param publisherEmail string param publisherName string param sslCert string param sslClientId string param sslKeyVault string

resource apim 'Microsoft.ApiManagement/service@2022-08-01' = { name: name location: 'westeurope' sku: { name: 'Developer' capacity: 1 } identity: { type: 'SystemAssigned, UserAssigned' userAssignedIdentities: { '${managedIdentityId}': {} } } properties: { apiVersionConstraint: { minApiVersion: '2021-08-01' } virtualNetworkType: 'None' publisherEmail: publisherEmail publisherName: publisherName publicNetworkAccess: 'Disabled' hostnameConfigurations: [ { certificateSource: 'KeyVault' hostName: hostname identityClientId: sslClientId keyVaultId: 'https://${sslKeyVault}${az.environment().suffixes.keyvaultDns}/secrets/${sslCert}' type: 'Proxy' } ] customProperties: { 'Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2': 'True' } }

resource appiLogger 'loggers' = { name: appiName properties: { loggerType: 'applicationInsights' description: 'Default logging to Application Insights.' resourceId: appiId credentials: { connectionString: appiConnectionString } } } }

2. In the Azure API Management extension, expand the APIs section of the created API Managment Service and the following error occurs.

Action: azureApiManagement.addApiFilter Error type: MissingOrIncorrectVersionParameter 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: linux
OS Release: 5.15.133.1-microsoft-standard-WSL2
Product: Visual Studio Code
Product Version: 1.86.2
Language: en

<details>
<summary>Call Stack</summary>

new RestError extension.bundle.js:16:65674 extension.bundle.js:16:329000



</details>
dozer75 commented 4 months ago

Found that the extension uses export APIM version 2019-12-01 (constants.ts) which isn't supported if you upgrade the version of your API management according to recommendations from API management installation. This needs to be updated or be configurable.

dozer75 commented 4 months ago

Found that #343 is the same issue, closing this.