0
votes

I'm trying to provision the following API Management via ARM, with the following template (note specifically the apiVersion date of 2016-07-07). This results in the error:

Invalid parameter: Value cannot be null.\r\nParameter name: skuproperties

{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
    "apimSettings": {
        "type": "object",
        "defaultValue": {
            "sku": "Developer",
            "skuCount": "1",
            "publisherName": "",
            "publisherEmail": ""
        }
    }
},
"variables": {
    "apiManagementServiceName": "[concat('apim', uniqueString(resourceGroup().id))]"
},
"resources": [{
    "apiVersion": "2016-07-07",
    "name": "[variables('apiManagementServiceName')]",
    "type": "Microsoft.ApiManagement/service",
    "location": "[resourceGroup().location]",
    "properties": {
        "sku": {
            "name": "[parameters('apimSettings').sku]",
            "capacity": "[parameters('apimSettings').skuCount]"
        },
        "publisherEmail": "[parameters('apimSettings').publisherEmail]",
        "publisherName": "[parameters('apimSettings').publisherName]"
    }
}],
"outputs": {
    "apimUri" : {
        "type": "object",
        "value": "[reference(variables('apiManagementServiceName'))]"
    }
}

}

The schema for that version of API Management doesn't show 'skuProperties'. Note, the deployment works if I use the old version 2014-02-14. I also noted that the deployment template schema refers to the newer API Management schema.

Clearly it wants "skuproperties" but how would I know what to provide there?

1

1 Answers

0
votes

this is how you use it:

    {
        "type": "Microsoft.ApiManagement/service",
        "sku": {
            "name": "Developer",
            "capacity": 1
        },
        "name": "[parameters('name')]",
        "apiVersion": "2016-10-10",
        "location": "[parameters('location')]",
        "properties": {
            "publisherEmail": "[parameters('adminEmail')]",
            "publisherName": "[parameters('orgName')]"
        }
    }

This is the description of the API Management API model. As you can see it uses 2016-10-10 and the object similar to what I've described. That's why its working that way.