gpt4 book ai didi

azure - 无法在 ARM 模板中为自动扩展属性添加多个配置文件

转载 作者:行者123 更新时间:2023-12-03 02:43:20 25 4
gpt4 key购买 nike

我有一个用于应用服务计划的自动扩展属性的 ARM 模板。当前只有一个默认配置文件。我想在默认配置文件中再添加一个配置文件。但在通过 VSTS 部署时它给了我错误。它允许我通过门户手动添加。

如何在 ARM Template 中添加多个配置文件?

下面的代码片段。

 {
"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."
}

最佳答案

由于第一个配置文件既不是固定日期也不是重复日期,因此自动缩放会运行始终为 1 的常规配置文件。这就是我收到这样的错误的原因。现在我将重复配置文件移至第一个,然后移至另一个。现在两者都运行良好。

关于azure - 无法在 ARM 模板中为自动扩展属性添加多个配置文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59963917/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com