Adding an API to a product using an ARM template

Leo Schelvis 101 Reputation points
2020-10-16T05:54:56.457+00:00

I try to add an API to an existing product using the following ARM template:

{  
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",  
    "contentVersion": "1.0.0.0",  
    "parameters": {},  
    "resources": [  
        {  
            "type": "Microsoft.ApiManagement/service/products/apis",  
            "apiVersion": "2019-01-01",  
            "name": "apim-id/product-id/api-id"  
		}  
    ]  
}  

I get the following error: Invalid payload format. Contract should have 'properties' specified.
However the properties are not specified in the Microsoft Learn documentation

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,801 questions
0 comments No comments
{count} votes

Accepted answer
  1. Leo Schelvis 101 Reputation points
    2020-10-16T10:57:59.387+00:00

    I fixed it by adding an empty properties element to the ARM template:

    {
         "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
         "contentVersion": "1.0.0.0",
         "parameters": {},
         "resources": [
             {
                 "type": "Microsoft.ApiManagement/service/products/apis",
                 "apiVersion": "2019-01-01",
                 "name": "apim-id/product-id/api-id",
                 "properties": {}
             }
         ]
     }
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful