API Management - make a revision current

2024-05-09T18:57:43.3133333+00:00

Using this API: https://learn.microsoft.com/en-us/rest/api/apimanagement/apis/update?view=rest-apimanagement-2022-08-01&tabs=HTTP
I'm trying to promote revision rev2 as Current

Powershell example

$jsonBody = @{

properties = @{

description = "xxxxx133"

isCurrent = $true

}

}

$responseX32 = Invoke-WebRequest -Uri "https://management.azure.com/subscriptions/$sub/resourceGroups/$rg/providers/Microsoft.ApiManagement/service/$($apim)/apis/OVA-CR-XXXX-API-INT-v1%3Brev%3D2?api-version=2023-05-01-preview" `

-Method Patch `

-Headers $headers `

-Body ($jsonBody | ConvertTo-Json)

Write-Host $responseX32

I'm able to change the description but isCurrent is still true for rev1 and not for rev2

{

"id": "/subscriptions/xxxxxx/resourceGroups/xxxx/providers/Microsoft.ApiManagement/service/xxxxxxx/apis/OVA-CR-XXXX-API-INT-v1;rev=2",

"type": "Microsoft.ApiManagement/service/apis",

"name": "OVA-CR-XXXX-API-INT-v1;rev=2",

"properties": {

"displayName": "OVA-CR-XXXX-API-INT-v1",

"apiRevision": "2",

"description": "xxxxx133",

"subscriptionRequired": false,

"serviceUrl": "http://sss.com",

"backendId": null,

"path": "int/ova/cr/us038/v1",

"protocols": [

  "http"

],

"authenticationSettings": {

  "oAuth2": null,

  "openid": null

},

"subscriptionKeyParameterNames": {

  "header": "Ocp-Apim-Subscription-Key",

  "query": "subscription-key"

}

}

}

Can you provide me the right way to make a revision current using REST API?

Azure
Azure
Una piattaforma e un'infrastruttura di cloud computing per la creazione, la distribuzione e la gestione di applicazioni e servizi tramite una rete mondiale di data center gestiti da Microsoft.
35 domande
0 commenti Nessun commento
{count} voti

1 risposta

Ordina per: Più utili
  1. Yordan Ivanov 535 Punti di reputazione
    2024-05-09T21:04:34.5666667+00:00

    Good evening, Riccardo,

    this is an italian forum. For the english forums, please follow this link: https://learn.microsoft.com/en-us/answers/questions/

    Thank you

    0 commenti Nessun commento