【问题标题】:ARM Template - AlertRules - UnsupporedMetricARM 模板 - AlertRules - UnsupportedMetric
【发布时间】:2017-07-01 22:43:54
【问题描述】:

我正在尝试创建一个 ARM 模板以将警报指标添加到我的弹性池数据库。我已在门户中手动完成此操作,并且正在使用从门户生成的 ARM 模板。

这是 ARM 模板:

    {
  "type": "microsoft.insights/alertrules",
  "name": "[parameters('alertrules_dtu_name')]",
  "apiVersion": "2014-04-01",
  "location": "westus",
  "tags": {
    "hidden-link:/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Sql/servers/xxx/elasticPools/ElasticPool1": "Resource"
  },
  "scale": null,
  "properties": {
    "name": "[parameters('alertrules_dtu_name')]",
    "description": "",
    "isEnabled": true,
    "condition": {
      "odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
      "dataSource": {
        "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
        "resourceUri": "[concat(resourceId('Microsoft.Sql/servers', parameters('sqlServerName')), '/elasticPools/ElasticPool1')]",
        "metricName": "[concat(parameters('alertrules_dtu_name'),'_consumption_percent')]"
      },
      "threshold": 90,
      "windowSize": "PT10M"
    },
    "action": {
      "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction",
      "customEmails": [
        "xxx@xxx.com"
      ]
    }
  }
}

这是我在部署时收到的错误消息:

New-AzureRmResourceGroupDeployment:下午 4:36:15 - 资源 microsoft.insights/alertrules 'DTUAlert' 失败 信息 '{ "code": "UnsupportedMetric", "message": "此资源不支持命名空间为 '' 且名称为 'DTUAlert_consumption_percent' 的指标

知道我在这里做错了什么吗?我已经尝试手动创建模板,针对不同版本的 API 等...仍然得到相同的错误。

【问题讨论】:

    标签: azure azure-sql-server azure-template


    【解决方案1】:

    指标名称看起来错误。您可以尝试使用以下指标名称 = dtu_consumption_percent 吗?

    【讨论】:

    • 非常感谢!我犯了一个愚蠢的错误!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-03
    • 2020-03-13
    • 2019-02-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多