0
votes

Very recently I am observing random PessimisticConcurrencyConflict error while performing some operation on Api Management through Azure Powershell. The full error details given below:

##[error] Error Code: PessimisticConcurrencyConflict Error Message: Operation on the API is in progress Request Id: a9e7d42f-252c-492f-8b45-aeee836c4467 ##[error]PowerShell exited with code '1'.

For instances, I am sure nobody is using the api at that time. The error goes away upon retrying the same powershell.

So far I have observed this issue while using below command in Azure Powershell:

  1. Creating a new Api Revision for an existing Api in Api Management by using

    New-AzApiManagementApiRevision -Context $context -ApiId $APIId -ApiRevision $apiRevision -ApiRevisionDescription $apiRevisionDescription

  2. Importing from an api specification file to an existing Api in Api Management using

    Import-AzApiManagementApi -Context $context -ApiId $apiId -ApiType Http -ApiRevision $apiRevision -Path $path -ServiceUrl $serviceUrl -SpecificationFormat Swagger -SpecificationPath "$SpecificationPath "

1

1 Answers

0
votes

You can't do two concurrent operations at the same entity, APIM locks the entity you are updating/creating until the operation completes and then you can do another operation, you have to wait until the first operation to otherwise it returns the pessimisticconcurrencyconflict error.