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
Questo browser non è più supportato.
Esegui l'aggiornamento a Microsoft Edge per sfruttare i vantaggi di funzionalità più recenti, aggiornamenti della sicurezza e supporto tecnico.
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?
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