我正在尝试创建 ARM 模板,以使用上面的模板作为参考,按照下面的方法在 Resources 中添加扩展和扩展属性。其他资源已创建,但 ARM 无法在我的 VMSS 模板中创建任何类型的自动缩放组。
{
"type": "microsoft.insights/autoscalesettings",
"apiVersion": "2015-04-01",
"name": "AutoScaleSet",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachineScaleSets/', parameters('VMSS_Name'))]"
],
"properties": {
"name": "autoscalehost",
"targetResourceUri": "[resourceId('Microsoft.Compute/virtualMachineScaleSets/', parameters('VMSS_Name'))]",
"enabled": true,
"profiles": [
{
"name": "autoscalehost",
"capacity": {
"minimum": "1",
"maximum": "3",
"default": "1"
},
"rules": [
{
"metricTrigger": {
"metricName": "Percentage CPU",
"metricResourceUri": "[concat('Microsoft.Compute/virtualMachineScaleSets', parameters('VMSS_Name'))]",
"timeGrain": "PT1M",
"statistic": "Average",
"timeWindow": "PT5M",
"timeAggregation": "Average",
"operator": "GreaterThan",
"threshold": 50
},
"scaleAction": {
"direction": "Increase",
"type": "ChangeCount",
"value": "1",
"cooldown": "PT5M"
}
},
{
"metricTrigger": {
"metricName": "Percentage CPU",
"metricResourceUri": "[concat('Microsoft.Compute/virtualMachineScaleSets', parameters('VMSS_Name'))]",
"timeGrain": "PT1M",
"statistic": "Average",
"timeWindow": "PT5M",
"timeAggregation": "Average",
"operator": "LessThan",
"threshold": 30
},
"scaleAction": {
"direction": "Decrease",
"type": "ChangeCount",
"value": "1",
"cooldown": "PT5M"
}
}
]
}
]
}
}