Azure API Management ARM模板:skuproperties不能为null

时间:2017-06-01 13:42:20

标签: azure azure-resource-manager azure-api-management

我正在尝试通过ARM配置以下API管理,并使用以下模板(特别注意2016-07-07的apiVersion日期)。这会导致错误:

  

参数无效:值不能为空。\ r \ n参数名称: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'))]"
    }
}

}

schema for that version of API Management未显示'skuProperties'。注意,如果我使用的是旧版本2014-02-14,则部署可以正常工作。我还注意到deployment template schema指的是较新的API Management架构。

显然它想要“skuproperties”,但我怎么知道在那里提供什么?

1 个答案:

答案 0 :(得分:0)

这就是你如何使用它:

    {
        "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')]"
        }
    }

这是description of the API Management API model。正如您所看到的,它使用了2016-10-10和类似于我所描述的对象。这就是它以这种方式工作的原因。