Azure 无法为ARM模板中的自动缩放属性添加多个配置文件
我有一个ARM模板用于应用程序服务计划的自动缩放属性。当前只有一个默认配置文件。我想在添加默认配置文件的同时再添加一个配置文件。但它在通过VST部署时给了我错误。它允许我通过门户手动添加 如何在ARM模板中添加多个配置文件 下面是代码片段Azure 无法为ARM模板中的自动缩放属性添加多个配置文件,azure,autoscaling,arm-template,azure-app-service-plans,azure-autoscaling-block,Azure,Autoscaling,Arm Template,Azure App Service Plans,Azure Autoscaling Block,我有一个ARM模板用于应用程序服务计划的自动缩放属性。当前只有一个默认配置文件。我想在添加默认配置文件的同时再添加一个配置文件。但它在通过VST部署时给了我错误。它允许我通过门户手动添加 如何在ARM模板中添加多个配置文件 下面是代码片段 { "type": "Microsoft.Web/serverfarms", "sku": { "name": "S1", "tier": "Standard", "size": "S1", "family": "S"
{
"type": "Microsoft.Web/serverfarms",
"sku": {
"name": "S1",
"tier": "Standard",
"size": "S1",
"family": "S",
"capacity": 1
},
"kind": "app",
"name": "[variables('ServerFarm_gateway_name')]",
"apiVersion": "2016-09-01",
"location": "[resourceGroup().location]",
"resources": [
{
"type": "Microsoft.Insights/autoscaleSettings",
"name": "[concat(variables('ServerFarm_gateway_name'),'-autoscaleout')]",
"apiVersion": "2015-04-01",
"location": "[resourceGroup().location]",
"properties": {
"profiles": [
{
"name": "Default",
"capacity": {
"minimum": "1",
"maximum": "5",
"default": "1"
},
"rules": [
{
"scaleAction": {
"direction": "Increase",
"type": "ChangeCount",
"value": "1",
"cooldown": "PT10M"
},
"metricTrigger": {
"metricName": "dependencies/duration",
"metricNamespace": "microsoft.insights/components/kusto",
"metricResourceUri": "[resourceId('Microsoft.Insights/components', variables('AppInsights_Name'))]",
"operator": "LessThan",
"statistic": "Average",
"threshold": 3000,
"timeAggregation": "Average",
"timeGrain": "PT1M",
"timeWindow": "PT5M",
"Dimensions": [],
"dividePerInstance": false
}
}
]
},
{
"name": "Auto created scale condition",
"capacity": {
"minimum": "1",
"maximum": "5",
"default": "1"
},
"rules": [
{
"scaleAction": {
"direction": "Decrease",
"type": "ChangeCount",
"value": "1",
"cooldown": "PT10M"
},
"metricTrigger": {
"metricName": "dependencies/duration",
"metricNamespace": "microsoft.insights/components/kusto",
"metricResourceUri": "[resourceId('Microsoft.Insights/components', variables('AppInsights_Name'))]",
"operator": "LessThan",
"statistic": "Average",
"threshold": 3000,
"timeAggregation": "Average",
"timeGrain": "PT1M",
"timeWindow": "PT5M",
"Dimensions": [],
"dividePerInstance": false
},
"recurrence": {
"frequency": "Week",
"schedule": {
"timeZone": "W. Europe Standard Time",
"days": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
],
"hours": [
0
],
"minutes": [
0
]
}
}
}
]
}
],
"enabled": true,
"targetResourceUri": "[resourceId('Microsoft.Web/serverfarms', variables('ServerFarm_gateway_name'))]"
},
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', variables('ServerFarm_gateway_name'))]"
]
}
],
"dependsOn": []
}
部署后出错:
[error]BadRequest: {
"code": "MultipleDefaultProfiles",
"message": "The autoscale setting that you provided has '2' default profiles, you can only specify one default profile per setting."
}
由于第一个配置文件既不是固定日期也不是定期,因此Autoscale运行的常规配置文件始终是一个。这就是为什么我会犯这样的错误。 现在我将重复配置文件移到第一个,然后移到另一个。现在两者都运转良好