Strange error deploying API revision

Muriuki, Levi M 266 Reputation points
2023-02-10T14:23:43.3433333+00:00

I'm trying to deploy a new revision for an API using bicep. The apiVersion, apiVersionSetId, and apiVersionDescription, are set to null as you can see below, but it keeps failing with this error.

Can't change property ApiVersion for non-current revision.

I really don't understand, this has been working fine until now. I even tried with Rest API and seeing same error..

Here are the API properties that I'm passing:

properties: {
    name: 'Invoices.Services.sandbox;rev=3'
    displayName: 'Invoices.Services.sandbox',
    apiRevision: 3,
    apiVersion: null,
    apiVersionSetId: null,
    apiVersionDescription: null,
    format: swagger-link-json,
    value: <swagger doc link>,
    subscriptionRequired: true,
    serviceUrl: <service url>,
    path: 'sandbox.Invoices',
    protocols: [
        https
    ],
    authenticationSettings: {
        oAuth2: null,
        openid: null
    },
    subscriptionKeyParameterNames: {
        header: 'Ocp-Apim-Subscription-Key',
        query: 'subscription-key'
    },
    isCurrent: false
}

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,338 questions
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 22,416 Reputation points
    2023-02-13T21:06:10.7266667+00:00

    Muriuki, Levi M Thank you for posting your question in Microsoft Q&A. Based on error message Can't change property ApiVersion for non-current revision., it appears that you are trying to modify ApiVersion property in non-current revision (isCurrent as false) with bicep.

    API version cannot be edited for a non-current revision and please review Revision descriptions for the list of the properties that cannot be edited (similar thread: https://learn.microsoft.com/en-us/answers/questions/1062269/cannot-update-api-description-for-an-api-revision posted by you).

    Validate if Invoices.Services.sandbox is versioned API for which API version is not null using https://learn.microsoft.com/en-us/rest/api/apimanagement/current-ga/apis/get?tabs=HTTP. If the value is null, and still face the issue, we might have to review the payload to understand more and investigate the issue (I couldn't repro this issue in my APIM). In such case, you would have to create a ticket to support team to share the payload info/details.

    I hope this helps your question and feel free to add a comment for any other questions. Would be happy to answer if any.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.