gpt4 book ai didi

azure - ARM 模板部署中 'Update autoscale settings' 上的 BadRequest

转载 作者:行者123 更新时间:2023-12-03 00:32:42 25 4
gpt4 key购买 nike

我正在尝试将扩展设置应用于模板化部署中的可用性集。我无法在 azure-quickstart-templates 中找到此特定用例的任何完整示例进行比较,并且语法错误的错误是无信息的“BadRequest”,没有其他信息。

这是我的模板自动缩放设置(否则部署正常)...

{
"apiVersion": "2014-04-01",
"dependsOn": [
"Microsoft.Compute/availabilitySets/workersas"
],
"location": "[resourceGroup().location]",
"name": "workersscaling",
"properties": {
"enabled": true,
"name": "workersscaling",
"profiles": [
{
"capacity": {
"default": 2,
"maximum": 4,
"minimum": 2
},
"name": "Default",
"rules": [
{
"metricTrigger": {
"metricName": "Percentage CPU",
"metricNamespace": "",
"metricResourceUri": "[resourceId('Microsoft.Compute/availabilitySets', 'workersas')]",
"operator": "GreaterThan",
"statistic": "Average",
"threshold": 80.0,
"timeAggregation": "Average",
"timeGrain": "PT1M",
"timeWindow": "PT10M"
},
"scaleAction": {
"cooldown": "PT10M",
"direction": "Increase",
"type": "ChangeCount",
"value": "1"
}
},
{
"metricTrigger": {
"metricName": "Percentage CPU",
"metricNamespace": "",
"metricResourceUri": "[resourceId('Microsoft.Compute/availabilitySets', 'workersas')]",
"operator": "LessThan",
"statistic": "Average",
"threshold": 40.0,
"timeAggregation": "Average",
"timeGrain": "PT1M",
"timeWindow": "PT10M"
},
"scaleAction": {
"cooldown": "PT10M",
"direction": "Decrease",
"type": "ChangeCount",
"value": "1"
}
}
]
}
],
"targetResourceUri": "[resourceId('Microsoft.Compute/availabilitySets', 'workersas')]"
},
"type": "microsoft.insights/autoscalesettings"
}

有人有任何见解吗?我根据response format found here构建了这个以及快速入门库中网站服务的自动缩放示例。

编辑:

尝试使用 Azure CLI 工具的更多信息...

~/ $ azure insights metrics definition list /subscriptions/.../resourceGroups/snrg/providers/Microsoft.Compute/availabilitySets/workersasinfo:    Executing command insights metrics definition list
+ Querying ""
error: No registered resource provider found for location 'northeurope' and API version '2014-04-01' for type 'availabilitySets'. The supported api-versions are '2014-12-01-preview, 2015-05-01-preview, 2015-06-15'. The supported locations are 'eastus, eastus2, westus, centralus, southcentralus, northeurope, westeurope, eastasia, southeastasia, japaneast, japanwest'.

也许我现在想做的事情根本不可能实现?

最佳答案

Azure PowerShell 模块尚不支持直接配置 Azure 自动缩放属性,因此我们希望结合使用 Azure PowerShell 和 Azure 服务管理 REST API 操作来进行自动缩放。 REST API 提供添加、删除、更新和检索 Autoscale 配置的操作。

引用号:http://blogs.technet.com/b/keithmayer/archive/2015/02/16/automating-azure-autoscale-via-powershell-and-rest-api.aspx

http://blogs.technet.com/b/keithmayer/archive/2015/07/20/managing-azure-resources-with-azure-resource-manager-arm-and-powershell.aspx

希望这对您有帮助。

吉里什·普拉吉瓦尔

关于azure - ARM 模板部署中 'Update autoscale settings' 上的 BadRequest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31569023/

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