Azure API Management deploy fails with '##[error]ValidationError: Operation references schema that does not exist.'

497 Views Asked by At

I have some ARM templates for API Management APIs and operations that have worked without any issues before. Suddenly it stopped working even if I have not done any changes to my ARM Template. I get error message:

##[error]ValidationError: Operation references schema that does not exist.

I always export my API's ARM template using the tool APIManagementARMTemplateCreator.

I think maybe Microsoft has done some changes. Some APIs still work and some does not work. I have tried to understand the difference. One theory is that the APIs that doesn't work have schemas and the ones that work does not use schemas.

2

There are 2 best solutions below

1
Markus Meyer On

It's just a guess because of missing details in your question, but I think you are referencing a retired version in the ARM template:

On 30 September 2023, all API versions for the Azure API Management service prior to 2021-08-01 will be retired and API calls using those API versions will fail.

API version retirements (September 2023)

Please try a newer version of Microsoft.ApiManagement service

e.g. version 2023-03-01-preview

Sample ARM:

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "resources": [
    {
      "type": "Microsoft.ApiManagement/service",
      "apiVersion": "2023-03-01-preview",
      "name": "apim",
      "location": "[resourceGroup().location]",
      "sku": {
        "name": "Developer",
        "capacity": 1
      },
      "properties": {
        "publisherEmail": "[email protected]",
        "publisherName": "lorem ipsum"
      }
    }
  ]
}
0
Iyad Abu-sneineh On

UPDATE

When I removed everything related to schemas in the ARM template it worked. So it has to do with something related to schemas. I still need to understand what has happened.