I have an ARM template for autoscaleout property for app service plan.Currently there is only one default profile.I want to add one more profile along with default. But it is giving me error while deploying via VSTS. It is allowing me to add via portal manually.
How can we add multiple profile in ARM Template?
Code snippet below.
{
"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 after deployment :
[error]BadRequest: {
"code": "MultipleDefaultProfiles",
"message": "The autoscale setting that you provided has '2' default profiles, you can only specify one default profile per setting."
}