我正在尝试通过ARM提供以下API管理,并使用以下模板(特别是注意2016-07-07的Apionsion日期(。这导致错误:
无效的参数:值不能为null。 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'))]"
}
}
}
该版本的API管理模式并未显示" Skuproperties"。请注意,如果我使用旧版本2014-02-14,则部署有效。我还指出,部署模板架构是指较新的API管理模式。
显然想要" skuproperties",但是我怎么知道在那里提供什么?
这就是您的使用方式:
{
"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')]"
}
}
这是API管理API模型的描述。如您所见,它使用2016-10-10和与我所描述的对象相似。这就是为什么它以这种方式工作的原因。