Azure API Management: can't create, list or use schemas
Hi, today I tried to create schemas for my API management API in order to be able to validate incoming requests against these schemas.
Unfortunately I can't create any schemas in the Azure Portal due to the error "Specified product name is already in use" that appears when I enter a schema name in the mask. No matter how random of a name I choose, it always shows this error.
Because I am anyway using Terraform to create my resources I didn't bother long to investigate this issue.
When I finished the implementation and tried to apply the changes I faced another strange error:
Error in element 'validate-content' on line 6, column 14: The schema pim does not exist.
Terraform was able to create the schema but I couldn't use it in a valide-content policy.
The schema, although being created by Terraform, didn't show up in the Azure Portal.
I investigated further and used https://learn.microsoft.com/en-us/rest/api/apimanagement/current-preview/api-schema/list-by-api to list all schemas for my API.
And there it was, my "pim" schema!
I went back to the Azure Portal where Schemas should be listed, opened the Browser console, and refreshed the page.
The request to list the Schemas that is sent to Azure is has this header set:
x-ms-path-query: /subscriptions/<my-subscription-id>/resourceGroups/<my-resource-group>/providers/Microsoft.ApiManagement/service/<my-api-management-service>/schemas?api-version=2021-04-01-preview&$top=20
This header compared to the path used in the above mentioned Azure Management Rest documentation is different:
The apis/{apiId} part is not in the request in the portal. I copied the request as a curl statement, added the apis/{apiId} part and it worked!
It seems like Azure devs really made a mistake here. It seems like that API Schemas are completely not usable right now. But how can this be? I'd guess many users are using this feature.
Anyone any ideas? Am I missing something?