我正在尝试使用AzureResourceManager PowerShell 模块来创建和配置网站。我从 Visual Studio 生成的模板文件开始,当我通过New-AzureResourceGroup -TemplateFile website.json
.
所以现在我正在尝试调整模板文件来配置站点。我正在尝试设置 php 和 .NET Framework 版本。根据架构,这些属性是通过资源数组中的配置对象设置的。
这是我的 json 模板的网站部分。“资源”部分是我添加的:
{
"apiVersion": "2014-06-01",
"name": "[parameters('siteName')]",
"type": "Microsoft.Web/sites",
"location": "[parameters('siteLocation')]",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource"
},
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"
],
"properties": {
"name": "[parameters('siteName')]",
"serverFarm": "[parameters('hostingPlanName')]"
},
"resources": [
{
"apiVersion": "2014-04-01",
"type": "Microsoft.Web/sites/config",
"name": "config",
"properties": {
"name": "config",
"phpVersion": "",
"netFrameworkVersion": "V4.5"
}
}
]
},
当我将此模板传递给Test-AzureResourceGroupTemplate
我时收到此错误:
Code : InvalidTemplate
Message : Deployment template validation failed: 'The template resource 'config' for type 'Microsoft.Web/sites/config' has
incorrect segment lengths. A nested resource type must have identical number of segments as its resource name. A root
resource type must have segment length one greater than its resource name'.
我找不到任何关于此的文档。有谁知道这个错误是什么意思,或者我做错了什么?