Azure ARM模板架构/文档,用于在数据库池上设置警报

时间:2016-08-03 17:45:52

标签: azure azure-sql-database azure-application-insights azure-monitoring sql-azure-alerts

我找不到可以通过ARM模板定义的事件/指标名称的文档,以便在SQL弹性数据库池上设置警报。例如,我猜“EdtuPercentage”是该指标的逻辑名称,但想知道在哪里查找它。我找不到在ARM Explorer上的门户上创建的警报。我感谢任何帮助!

{
  "name": "[concat(variables('createElasticPoolOperationName'), '-0')]",
  "type": "Microsoft.Resources/deployments",
  "apiVersion": "2015-01-01",
  "dependsOn": [ "[concat('Microsoft.Resources/deployments/', variables('createSqlServerOperationName'))]" ],
  "properties": {
    "mode": "Incremental",
    "templateLink": {
      "uri": "[variables('templateUrls').CreateSqlElasticPoolTemplateUrl]",
      "contentVersion": "1.0.0.0"
    },
    "parameters": {
      "sqlServerName": {
        "value": "[variables('sqlServerName')]"
      },
      "name": {
        "value": "[concat(variables('elasticPoolCanonicalName'), '-0')]"
      },
      "edition": {
        "value": "[parameters('elasticPoolSettings').edition]"
      },
      "dtu": {
        "value": "[parameters('elasticPoolSettings').dtu]"
      },
      "databaseDtuMin": {
        "value": "[parameters('elasticPoolSettings').databaseDtuMin]"
      },
      "databaseDtuMax": {
        "value": "[parameters('elasticPoolSettings').databaseDtuMax]"
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.Insights/alertRules",
      "name": "[parameters('alertSettings').name]",
      "location": "[resourceGroup().location]",
      "apiVersion": "2014-04-01",
      "properties": {
        "name": "[parameters('alertSettings').name]",
        "description": "[parameters('alertSettings').description]",
        "isEnabled": true,
        "condition": {
          "odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
              "dataSource": {
                "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
                "resourceUri": "/subscriptions/089bd33f-d4ec-47fe-8ba5-0753aa5c5b33/resourceGroups/Default-Storage-NorthCentralUS/providers/Microsoft.Web/serverfarms/Plan",
                "metricName": "EdtuPercentage"
              },
          "threshold": 1,
          "windowSize": "PT15M",
          "timeAggregation": "Average"
        },
        "action": {
          "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction",
          "sendToServiceOwners": "[parameters('alertSettings').sendToServiceOwners]"
        }
      }
    }

  ]
}

1 个答案:

答案 0 :(得分:3)

要查找可在特定资源上设置的所有适用/可用指标的列表,请使用powerShell命令。 您可以使用此powershell命令获取所有此类指标的列表及其逻辑名称。

获取-AzureRmMetricDefinition

例如,如果要查找弹性池警报的度量标准列表,可以使用此命令,

Get-AzureRmMetricDefinition -ResourceId“ElasticPoolResourceId”

您可以在此处提供弹性池的resourceID作为参数。它将为您提供设置警报的所有适用指标的列表。

希望这有帮助!