Azure / bicep-types-az

Bicep type definitions for ARM resources
MIT License
86 stars 27 forks source link

APIM API version sets version no longer supported #1942

Open milkyware opened 1 year ago

milkyware commented 1 year ago

One of the Azure Defender for cloud recommendations for APIM is to set the minimum API version to 2019-12-01. Below is a snippet of the Bicep module I use for deploying versioned APIM APIs

resource apim 'Microsoft.ApiManagement/service@2022-04-01-preview' existing = {
    name: apimName

    resource apiVersionSet 'api-version-sets@2018-06-01-preview' = if (enableApiVersioning) {
        name: apiName
        properties: {
            displayName: displayName
            versioningScheme: versionScheme
            versionHeaderName: 'X-Api-Version'
            versionQueryName: 'api-version'
        }
    }
}

The api-version-sets resource has the latest API version of 2018-06-01-preview. When running the az deployment the error returned is MissingOrIncorrectVersionParameter. Can the API version for api-version-sets be updated to avoid this?

microsoft-github-policy-service[bot] commented 9 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @adrianhall, @KedarJoshi. Please see https://aka.ms/biceptypesinfo for troubleshooting help.

GABRIELNGBTUC commented 6 months ago

I think it's important to get an answer fast. The API versions below the one mentioned in the issue will be blocked by the APIM service in less than one month. And so far, trying to update the API version to 2019-12-01 or later results in a bad request from the deployment.

Many companies using api version sets with bicep are about to get their deployment blocked and there is no evident solution so far.

GABRIELNGBTUC commented 5 months ago

For everyone impacted by this, I seem to have found the solution.

There seems to be a new api called "ApiVersionSet" instead of "api-version-sets". After renaming my resource type to this, deployments are working on newer api versions.