An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hi Abigail,
We reached out to backend team regarding the issue and got an update on the issue. Please find the update below.
Issue:
There are two symptoms of this issue:
- Users are unable to create an API with a certain name, and they don't see another API with the same name. Creating the API with a certain name fails with a 404.
- After creating a new release for an existing API, the API and all its revisions disappear from the Azure Portal. Gateway API requests to the API will also start failing with a 404.
Cause:
- This issue happens due to a concurrency related race condition bug when two releases of the same API is performed at almost the same time. Due to the race condition, the situation arises where the API still exists in the DB, but it has no revision marked as "Current". Because the API has no current revisions, it does not appear in Azure portal and cannot be used for Gateway API calls.
- Another scenario where this could happen is if customer tries to change the current revision of an API while another asynchronous operation is already running on the API. One example of an asynchronous operation is importing an API spec.
Workaround:
There is only one possible workaround at the moment. You will need to use PowerShell or REST API to use these workarounds since the API is not visible in the Portal:
- Delete the API and all its revisions and deploy it again using their CI/CD pipelines.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}?deleteRevisions={deleteRevisions}&api-version=2024-05-01
Prevention:
- To prevent this from happening, you should ensure there at least a 10-minute delay between the time the import of API and change in the current revision of the API.
- Alternately, please create a new revision and then update the API by importing the new definition.
Currently, permanent fix for the known issue is in progress. There is no ETA defined at this moment. I will update you once I hear back on this. Meanwhile, we need to use workaround to fix the issue.