你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.Insights alertrules

Bicep 资源定义

可以使用面向以下操作部署 alertrules 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Insights/alertrules 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.Insights/alertrules@2016-03-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    action: {
      'odata.type': 'string'
      // For remaining properties, see RuleAction objects
    }
    actions: [
      {
        'odata.type': 'string'
        // For remaining properties, see RuleAction objects
      }
    ]
    condition: {
      dataSource: {
        legacyResourceId: 'string'
        metricNamespace: 'string'
        resourceLocation: 'string'
        resourceUri: 'string'
        'odata.type': 'string'
        // For remaining properties, see RuleDataSource objects
      }
      'odata.type': 'string'
      // For remaining properties, see RuleCondition objects
    }
    description: 'string'
    isEnabled: bool
    name: 'string'
    provisioningState: 'string'
  }
}

RuleAction 对象

设置 odata.type 属性以指定对象的类型。

对于 Microsoft.Azure.Management.Insights.Models.RuleEmailAction,请使用:

  'odata.type': 'Microsoft.Azure.Management.Insights.Models.RuleEmailAction'
  customEmails: [
    'string'
  ]
  sendToServiceOwners: bool

对于 Microsoft.Azure.Management.Insights.Models.RuleWebhookAction,请使用:

  'odata.type': 'Microsoft.Azure.Management.Insights.Models.RuleWebhookAction'
  properties: {}
  serviceUri: 'string'

RuleCondition 对象

设置 odata.type 属性以指定对象的类型。

对于 Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition,请使用:

  'odata.type': 'Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition'
  failedLocationCount: int
  windowSize: 'string'

对于 Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition,请使用:

  'odata.type': 'Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition'
  aggregation: {
    operator: 'string'
    threshold: int
    windowSize: 'string'
  }

对于 Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition,请使用:

  'odata.type': 'Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition'
  operator: 'string'
  threshold: int
  timeAggregation: 'string'
  windowSize: 'string'

RuleDataSource 对象

设置 odata.type 属性以指定对象的类型。

对于 Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource,请使用:

  'odata.type': 'Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource'
  claims: {
    emailAddress: 'string'
  }
  eventName: 'string'
  eventSource: 'string'
  level: 'string'
  operationName: 'string'
  resourceGroupName: 'string'
  resourceProviderName: 'string'
  status: 'string'
  subStatus: 'string'

对于 Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource,请使用:

  'odata.type': 'Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource'
  metricName: 'string'

属性值

alertrules

名称 说明
name 资源名称 字符串 (必需)
location 资源位置 字符串 (必需)
标记 资源标记 标记名称和值的字典。 请参阅 模板中的标记
properties 资源的警报规则属性。 需要 AlertRule ()

AlertRule

名称 说明
action 在警报规则变为活动状态以及解决警报条件时执行的操作。 RuleAction
actions 警报规则变为活动状态以及解决警报条件时执行的操作数组。 RuleAction[]
condition 导致激活警报规则的条件。 需要 ruleCondition ()
description 警报电子邮件中将包含的警报规则的说明。 字符串
isEnabled 指示是否启用警报规则的标志。 需要 bool ()
name 警报规则的名称。 字符串 (必需)
provisioningState 预配状态。 字符串

RuleAction

名称 说明
odata.type 设置对象类型 Microsoft.Azure.Management.Insights.Models.RuleEmailAction
Microsoft.Azure.Management.Insights.Models.RuleWebhookAction (必需)

RuleEmailAction

名称 说明
odata.type 指定操作的类型。 有两种类型的操作:RuleEmailAction 和 RuleWebhookAction。 需要“Microsoft.Azure.Management.Insights.Models.RuleEmailAction” ()
customEmails 要通知警报激活的管理员自定义电子邮件地址的列表。 string[]
sendToServiceOwners 服务管理员(服务和协同管理员)在警报激活后是否应获得通知。 bool

RuleWebhookAction

名称 说明
odata.type 指定操作的类型。 有两种类型的操作:RuleEmailAction 和 RuleWebhookAction。 需要“Microsoft.Azure.Management.Insights.Models.RuleWebhookAction” ()
properties 要包含在发布操作中的自定义属性的字典。 这些数据追加到 Webhook 有效负载。 对象 (object)
serviceUri 在警报激活或解决时发布通知的服务 URI。 字符串

RuleCondition

名称 说明
dataSource 规则从中收集数据的资源。 对于此类型,dataSource 将始终为 RuleMetricDataSource 类型。 RuleDataSource
odata.type 设置对象类型 Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition
Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition
需要 Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition ()

RuleDataSource

名称 说明
legacyResourceId 规则监视的资源的旧资源标识符。 注意:无法为现有规则更新此属性。 字符串
metricNamespace 指标的命名空间。 字符串
resourceLocation 资源的位置。 字符串
resourceUri 规则监视的资源的资源标识符。 注意:无法为现有规则更新此属性。 字符串
odata.type 设置对象类型 Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource
需要 Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource ()

RuleManagementEventDataSource

名称 说明
odata.type 指定数据源的类型。 有两种类型的规则数据源:RuleMetricDataSource 和 RuleManagementEventDataSource 需要“Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource” ()
声明 声明。 RuleManagementEventClaimsDataSource
eventName 事件名称。 字符串
eventSource 事件源。 字符串
level 级别。 字符串
operationName 应该检查的操作的名称。 如果未提供任何名称,则任何操作都将匹配。 字符串
resourceGroupName 资源组名称。 字符串
resourceProviderName 资源提供程序名称。 字符串
status 应该检查的操作的状态。 如果未提供状态,则任何状态都将匹配。 字符串
subStatus 子状态。 字符串

RuleManagementEventClaimsDataSource

名称 说明
emailAddress 电子邮件地址。 字符串

RuleMetricDataSource

名称 说明
odata.type 指定数据源的类型。 有两种类型的规则数据源:RuleMetricDataSource 和 RuleManagementEventDataSource 需要“Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource” ()
metricName 定义规则监视的指标的名称。 字符串

LocationThresholdRuleCondition

名称 说明
odata.type 指定条件的类型。 这可以是以下三种类型之一:ManagementEventRuleCondition (管理事件) 、LocationThresholdRuleCondition ((基于 Web 测试) 的失败次数)和 ThresholdRuleCondition (基于指标) 的阈值。 需要“Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition” ()
failedLocationCount 必须无法激活警报的位置数。 int (必需)

约束:
最小值 = 0
windowSize iso 8601 持续时间格式 (的时间段) ,用于根据阈值监视警报活动。 如果指定,则它必须介于 5 分钟到 1 天之间。 字符串

ManagementEventRuleCondition

名称 说明
odata.type 指定条件的类型。 这可以是以下三种类型之一:ManagementEventRuleCondition (管理事件) 、LocationThresholdRuleCondition ((基于 Web 测试) 的失败次数)和 ThresholdRuleCondition (基于指标) 的阈值。 “Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition” (必需的)
aggregation 收集的数据应如何随着时间推移以及警报的激活时间组合在一起。 请注意,对于管理事件警报,聚合是可选的;如果未提供任何聚合,则任何事件都将导致激活警报。 ManagementEventAggregationCondition

ManagementEventAggregationCondition

名称 说明
运算符后的表达式 条件运算符。 “GreaterThan”
“GreaterThanOrEqual”
“LessThan”
“LessThanOrEqual”
阈值 激活警报的阈值。 int
windowSize iso 8601 持续时间格式 (的时间段) ,用于根据阈值监视警报活动。 如果指定,则它必须介于 5 分钟到 1 天之间。 字符串

ThresholdRuleCondition

名称 说明
odata.type 指定条件的类型。 这可以是以下三种类型之一:ManagementEventRuleCondition (管理事件) 、LocationThresholdRuleCondition ((基于 Web 测试) 的失败次数)和 ThresholdRuleCondition (基于指标) 的阈值。 需要“Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition” ()
运算符后的表达式 用于比较数据和阈值的运算符。 “GreaterThan”
“GreaterThanOrEqual”
“LessThan”
需要“LessThanOrEqual” ()
阈值 激活警报的阈值。 int (必需)
timeAggregation 时间聚合运算符。 收集的数据应如何随着时间推移而合并。 默认值为 Metric 的 PrimaryAggregationType。 'Average'
“Last”
“Maximum”
“Minimum”
“Total”
windowSize iso 8601 持续时间格式 (的时间段) ,用于根据阈值监视警报活动。 如果指定,则它必须介于 5 分钟到 1 天之间。 字符串

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
对虚拟机的 DDoS 攻击

部署到 Azure
这将部署虚拟机、OMS 和其他网络资源。 按照 guidleines 执行 DDoS 攻击,并执行方案以检测 DDoS 攻击。

ARM 模板资源定义

可以使用面向以下操作部署 alertrules 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Insights/alertrules 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.Insights/alertrules",
  "apiVersion": "2016-03-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "action": {
      "odata.type": "string"
      // For remaining properties, see RuleAction objects
    },
    "actions": [
      {
        "odata.type": "string"
        // For remaining properties, see RuleAction objects
      }
    ],
    "condition": {
      "dataSource": {
        "legacyResourceId": "string",
        "metricNamespace": "string",
        "resourceLocation": "string",
        "resourceUri": "string",
        "odata.type": "string"
        // For remaining properties, see RuleDataSource objects
      },
      "odata.type": "string"
      // For remaining properties, see RuleCondition objects
    },
    "description": "string",
    "isEnabled": "bool",
    "name": "string",
    "provisioningState": "string"
  }
}

RuleAction 对象

设置 odata.type 属性以指定对象的类型。

对于 Microsoft.Azure.Management.Insights.Models.RuleEmailAction,请使用:

  "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleEmailAction",
  "customEmails": [ "string" ],
  "sendToServiceOwners": "bool"

对于 Microsoft.Azure.Management.Insights.Models.RuleWebhookAction,请使用:

  "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction",
  "properties": {},
  "serviceUri": "string"

RuleCondition 对象

设置 odata.type 属性以指定对象的类型。

对于 Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition,请使用:

  "odata.type": "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition",
  "failedLocationCount": "int",
  "windowSize": "string"

对于 Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition,请使用:

  "odata.type": "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition",
  "aggregation": {
    "operator": "string",
    "threshold": "int",
    "windowSize": "string"
  }

对于 Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition,请使用:

  "odata.type": "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition",
  "operator": "string",
  "threshold": "int",
  "timeAggregation": "string",
  "windowSize": "string"

RuleDataSource 对象

设置 odata.type 属性以指定对象的类型。

对于 Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource,请使用:

  "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource",
  "claims": {
    "emailAddress": "string"
  },
  "eventName": "string",
  "eventSource": "string",
  "level": "string",
  "operationName": "string",
  "resourceGroupName": "string",
  "resourceProviderName": "string",
  "status": "string",
  "subStatus": "string"

对于 Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource,请使用:

  "odata.type": "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource",
  "metricName": "string"

属性值

alertrules

名称 说明 Value
type 资源类型 “Microsoft.Insights/alertrules”
apiVersion 资源 API 版本 '2016-03-01'
name 资源名称 字符串 (必需)
location 资源位置 字符串 (必需)
标记 资源标记 标记名称和值的字典。 请参阅 模板中的标记
properties 资源的警报规则属性。 需要 AlertRule ()

AlertRule

名称 说明
action 在警报规则变为活动状态以及解决警报条件时执行的操作。 RuleAction
actions 警报规则变为活动状态以及解决警报条件时执行的操作数组。 RuleAction[]
condition 导致激活警报规则的条件。 RuleCondition (必需)
description 警报电子邮件中将包含的警报规则的说明。 字符串
isEnabled 指示是否启用警报规则的标志。 bool (必需)
name 警报规则的名称。 字符串 (必需)
provisioningState 预配状态。 字符串

RuleAction

名称 说明
odata.type 设置对象类型 Microsoft.Azure.Management.Insights.Models.RuleEmailAction
Microsoft.Azure.Management.Insights.Models.RuleWebhookAction (必需)

RuleEmailAction

名称 说明
odata.type 指定操作的类型。 有两种类型的操作:RuleEmailAction 和 RuleWebhookAction。 需要“Microsoft.Azure.Management.Insights.Models.RuleEmailAction” ()
customEmails 用于通知警报激活的管理员自定义电子邮件地址列表。 string[]
sendToServiceOwners 服务管理员(服务和协同管理员)在警报激活后是否应获得通知。 bool

RuleWebhookAction

名称 说明
odata.type 指定操作的类型。 有两种类型的操作:RuleEmailAction 和 RuleWebhookAction。 需要“Microsoft.Azure.Management.Insights.Models.RuleWebhookAction” ()
properties 要包含在发布操作中的自定义属性的字典。 这些数据追加到 Webhook 有效负载。 对象 (object)
serviceUri 在警报激活或解决时发布通知的服务 URI。 字符串

RuleCondition

名称 说明
dataSource 规则从中收集数据的资源。 对于此类型,dataSource 将始终为 RuleMetricDataSource 类型。 RuleDataSource
odata.type 设置对象类型 Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition
Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition
需要 Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition ()

RuleDataSource

名称 说明
legacyResourceId 规则监视的资源的旧资源标识符。 注意:无法为现有规则更新此属性。 字符串
metricNamespace 指标的命名空间。 字符串
resourceLocation 资源的位置。 字符串
resourceUri 规则监视的资源的资源标识符。 注意:无法为现有规则更新此属性。 字符串
odata.type 设置对象类型 Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource
需要 Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource ()

RuleManagementEventDataSource

名称 说明
odata.type 指定数据源的类型。 有两种类型的规则数据源:RuleMetricDataSource 和 RuleManagementEventDataSource 需要“Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource” ()
声明 声明。 RuleManagementEventClaimsDataSource
eventName 事件名称。 字符串
eventSource 事件源。 字符串
level 级别。 字符串
operationName 应该检查的操作的名称。 如果未提供任何名称,则任何操作都将匹配。 字符串
resourceGroupName 资源组名称。 字符串
resourceProviderName 资源提供程序名称。 字符串
status 应该检查的操作的状态。 如果未提供状态,则任何状态都将匹配。 字符串
subStatus 子状态。 字符串

RuleManagementEventClaimsDataSource

名称 说明
emailAddress 电子邮件地址。 字符串

RuleMetricDataSource

名称 说明
odata.type 指定数据源的类型。 有两种类型的规则数据源:RuleMetricDataSource 和 RuleManagementEventDataSource 需要“Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource” ()
metricName 定义规则监视的指标的名称。 字符串

LocationThresholdRuleCondition

名称 说明
odata.type 指定条件的类型。 这可以是以下三种类型之一:ManagementEventRuleCondition (管理事件) 、LocationThresholdRuleCondition ((基于 Web 测试) 的失败次数)和基于指标) 阈值的 ThresholdRuleCondition (。 需要“Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition” ()
failedLocationCount 必须无法激活警报的位置数。 int (必需)

约束:
最小值 = 0
windowSize (ISO 8601 持续时间格式) ,用于根据阈值监视警报活动。 如果指定,则它必须介于 5 分钟到 1 天之间。 字符串

ManagementEventRuleCondition

名称 说明
odata.type 指定条件的类型。 这可以是以下三种类型之一:ManagementEventRuleCondition (管理事件) 、LocationThresholdRuleCondition ((基于 Web 测试) 的失败次数)和基于指标) 阈值的 ThresholdRuleCondition (。 需要“Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition” ()
aggregation 收集的数据应如何随着时间推移以及警报的激活时间进行组合。 请注意,对于管理事件警报,聚合是可选的;如果未提供任何聚合,则任何事件都将导致激活警报。 ManagementEventAggregationCondition

ManagementEventAggregationCondition

名称 说明
运算符后的表达式 条件运算符。 “GreaterThan”
“GreaterThanOrEqual”
“LessThan”
“LessThanOrEqual”
阈值 激活警报的阈值。 int
windowSize (ISO 8601 持续时间格式) ,用于根据阈值监视警报活动。 如果指定,则它必须介于 5 分钟到 1 天之间。 字符串

ThresholdRuleCondition

名称 说明
odata.type 指定条件的类型。 这可以是以下三种类型之一:ManagementEventRuleCondition (管理事件) 、LocationThresholdRuleCondition ((基于 Web 测试) 的失败次数)和基于指标) 阈值的 ThresholdRuleCondition (。 需要“Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition” ()
运算符后的表达式 用于比较数据和阈值的运算符。 “GreaterThan”
“GreaterThanOrEqual”
“LessThan”
“LessThanOrEqual” (必需)
阈值 激活警报的阈值。 int (必需)
timeAggregation 时间聚合运算符。 收集的数据应如何随时间推移进行组合。 默认值为 Metric 的 PrimaryAggregationType。 “平均”
“Last”
“Maximum”
“Minimum”
“Total”
windowSize (ISO 8601 持续时间格式) ,用于根据阈值监视警报活动。 如果指定,则它必须介于 5 分钟到 1 天之间。 字符串

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
对虚拟机的 DDoS 攻击

部署到 Azure
这将部署虚拟机、OMS 和其他网络资源。 按照 guidleine 执行 DDoS 攻击,并执行用于检测 DDoS 攻击的方案。

Terraform (AzAPI 提供程序) 资源定义

可以使用针对以下操作部署 alertrules 资源类型:

  • 资源组

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Insights/alertrules 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Insights/alertrules@2016-03-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      action = {
        odata.type = "string"
        // For remaining properties, see RuleAction objects
      }
      actions = [
        {
          odata.type = "string"
          // For remaining properties, see RuleAction objects
        }
      ]
      condition = {
        dataSource = {
          legacyResourceId = "string"
          metricNamespace = "string"
          resourceLocation = "string"
          resourceUri = "string"
          odata.type = "string"
          // For remaining properties, see RuleDataSource objects
        }
        odata.type = "string"
        // For remaining properties, see RuleCondition objects
      }
      description = "string"
      isEnabled = bool
      name = "string"
      provisioningState = "string"
    }
  })
}

RuleAction 对象

设置 odata.type 属性以指定 对象的类型。

对于 Microsoft.Azure.Management.Insights.Models.RuleEmailAction,请使用:

  odata.type = "Microsoft.Azure.Management.Insights.Models.RuleEmailAction"
  customEmails = [
    "string"
  ]
  sendToServiceOwners = bool

对于 Microsoft.Azure.Management.Insights.Models.RuleWebhookAction,请使用:

  odata.type = "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction"
  properties = {}
  serviceUri = "string"

RuleCondition 对象

设置 odata.type 属性以指定 对象的类型。

对于 Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition,请使用:

  odata.type = "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition"
  failedLocationCount = int
  windowSize = "string"

对于 Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition,请使用:

  odata.type = "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition"
  aggregation = {
    operator = "string"
    threshold = int
    windowSize = "string"
  }

对于 Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition,请使用:

  odata.type = "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition"
  operator = "string"
  threshold = int
  timeAggregation = "string"
  windowSize = "string"

RuleDataSource 对象

设置 odata.type 属性以指定 对象的类型。

对于 Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource,请使用:

  odata.type = "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource"
  claims = {
    emailAddress = "string"
  }
  eventName = "string"
  eventSource = "string"
  level = "string"
  operationName = "string"
  resourceGroupName = "string"
  resourceProviderName = "string"
  status = "string"
  subStatus = "string"

对于 Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource,请使用:

  odata.type = "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource"
  metricName = "string"

属性值

alertrules

名称 说明 Value
type 资源类型 “Microsoft.Insights/alertrules@2016-03-01”
name 资源名称 字符串 (必需)
location 资源位置 字符串 (必需)
parent_id 若要部署到资源组,请使用该资源组的 ID。 字符串 (必需)
标记 资源标记 标记名称和值的字典。
properties 资源的警报规则属性。 需要 AlertRule ()

AlertRule

名称 说明
action 在警报规则变为活动状态以及解决警报条件时执行的操作。 RuleAction
actions 警报规则变为活动状态以及解决警报条件时执行的操作数组。 RuleAction[]
condition 导致激活警报规则的条件。 需要 ruleCondition ()
description 警报电子邮件中将包含的警报规则的说明。 字符串
isEnabled 指示是否启用警报规则的标志。 需要 bool ()
name 警报规则的名称。 字符串 (必需)
provisioningState 预配状态。 字符串

RuleAction

名称 说明
odata.type 设置对象类型 Microsoft.Azure.Management.Insights.Models.RuleEmailAction
Microsoft.Azure.Management.Insights.Models.RuleWebhookAction (必需)

RuleEmailAction

名称 说明
odata.type 指定操作的类型。 有两种类型的操作:RuleEmailAction 和 RuleWebhookAction。 “Microsoft.Azure.Management.Insights.Models.RuleEmailAction” (必需)
customEmails 要通知警报激活的管理员自定义电子邮件地址的列表。 string[]
sendToServiceOwners 服务管理员(服务和协同管理员)在警报激活后是否应获得通知。 bool

RuleWebhookAction

名称 说明
odata.type 指定操作的类型。 有两种类型的操作:RuleEmailAction 和 RuleWebhookAction。 “Microsoft.Azure.Management.Insights.Models.RuleWebhookAction” (必需)
properties 要包含在后期操作中的自定义属性的字典。 这些数据将追加到 Webhook 有效负载。 对象 (object)
serviceUri 服务 URI,用于在警报激活或解决时发布通知。 字符串

RuleCondition

名称 说明
dataSource 规则从中收集数据的资源。 对于此类型,dataSource 将始终为 RuleMetricDataSource 类型。 RuleDataSource
odata.type 设置对象类型 Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition
Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition
Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition (所需的)

RuleDataSource

名称 说明
legacyResourceId 规则监视的资源的旧资源标识符。 注意:无法为现有规则更新此属性。 字符串
metricNamespace 指标的命名空间。 字符串
resourceLocation 资源的位置。 字符串
resourceUri 规则监视的资源的资源标识符。 注意:无法为现有规则更新此属性。 字符串
odata.type 设置对象类型 Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource
Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource (必需)

RuleManagementEventDataSource

名称 说明
odata.type 指定数据源的类型。 有两种类型的规则数据源:RuleMetricDataSource 和 RuleManagementEventDataSource “Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource” (需要)
声明 声明。 RuleManagementEventClaimsDataSource
eventName 事件名称。 字符串
eventSource 事件源。 字符串
level 级别。 字符串
operationName 应该检查的操作的名称。 如果未提供任何名称,则任何操作都将匹配。 字符串
resourceGroupName 资源组名称。 字符串
resourceProviderName 资源提供程序名称。 字符串
status 应该检查的操作的状态。 如果未提供状态,则任何状态都将匹配。 字符串
subStatus 子状态。 字符串

RuleManagementEventClaimsDataSource

名称 说明
emailAddress 电子邮件地址。 字符串

RuleMetricDataSource

名称 说明
odata.type 指定数据源的类型。 有两种类型的规则数据源:RuleMetricDataSource 和 RuleManagementEventDataSource 需要“Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource” ()
metricName 定义规则监视的指标的名称。 字符串

LocationThresholdRuleCondition

名称 说明
odata.type 指定条件的类型。 这可以是以下三种类型之一:ManagementEventRuleCondition (管理事件) 、LocationThresholdRuleCondition ((基于 Web 测试) 的失败次数)和基于指标) 阈值的 ThresholdRuleCondition (。 “Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition” (必需)
failedLocationCount 必须无法激活警报的位置数。 int (必需)

约束:
最小值 = 0
windowSize (ISO 8601 持续时间格式) ,用于根据阈值监视警报活动。 如果指定,则它必须介于 5 分钟到 1 天之间。 字符串

ManagementEventRuleCondition

名称 说明
odata.type 指定条件的类型。 这可以是以下三种类型之一:ManagementEventRuleCondition (管理事件) 、LocationThresholdRuleCondition ((基于 Web 测试) 的失败次数)和基于指标) 阈值的 ThresholdRuleCondition (。 需要“Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition” ()
aggregation 收集的数据应如何随着时间推移以及警报的激活时间进行组合。 请注意,对于管理事件警报,聚合是可选的;如果未提供任何聚合,则任何事件都将导致激活警报。 ManagementEventAggregationCondition

ManagementEventAggregationCondition

名称 说明
运算符后的表达式 条件运算符。 “GreaterThan”
“GreaterThanOrEqual”
“LessThan”
“LessThanOrEqual”
阈值 激活警报的阈值。 int
windowSize (ISO 8601 持续时间格式) ,用于根据阈值监视警报活动。 如果指定,则它必须介于 5 分钟到 1 天之间。 字符串

ThresholdRuleCondition

名称 说明
odata.type 指定条件的类型。 这可以是以下三种类型之一:ManagementEventRuleCondition (管理事件) 、LocationThresholdRuleCondition ((基于 Web 测试) 的失败次数)和基于指标) 阈值的 ThresholdRuleCondition (。 需要“Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition” ()
运算符后的表达式 用于比较数据和阈值的运算符。 “GreaterThan”
“GreaterThanOrEqual”
“LessThan”
需要“LessThanOrEqual” ()
阈值 激活警报的阈值。 int (必需)
timeAggregation 时间聚合运算符。 收集的数据应如何随时间推移进行组合。 默认值为 Metric 的 PrimaryAggregationType。 “Average”
“Last”
“最大值”
“Minimum”
“Total”
windowSize (ISO 8601 持续时间格式) ,用于根据阈值监视警报活动。 如果指定,则它必须介于 5 分钟到 1 天之间。 字符串