microsoft.alertsManagement smartDetectorAlertRules(microsoft.alertsmanagement)

備考

監視ソリューションのデプロイに関するガイダンスについては、「Bicepを使用した監視リソースの作成 」を参照してください。

Bicep リソース定義

smartDetectorAlertRules リソースの種類は、次をターゲットとする操作と共にデプロイできます。

  • リソース グループの - リソース グループのデプロイ コマンド 参照

各 API バージョンで変更されたプロパティの一覧については、変更ログの参照してください。

使用例

Bicep サンプル

Monitor Smart Detector Alert Ruleのデプロイの基本的な例。

param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource actionGroup 'Microsoft.Insights/actionGroups@2023-01-01' = {
  name: resourceName
  location: 'global'
  properties: {
    armRoleReceivers: []
    automationRunbookReceivers: []
    azureAppPushReceivers: []
    azureFunctionReceivers: []
    emailReceivers: []
    enabled: true
    eventHubReceivers: []
    groupShortName: 'acctestag'
    itsmReceivers: []
    logicAppReceivers: []
    smsReceivers: []
    voiceReceivers: []
    webhookReceivers: []
  }
}

resource component 'Microsoft.Insights/components@2020-02-02' = {
  name: resourceName
  location: location
  kind: 'web'
  properties: {
    Application_Type: 'web'
    DisableIpMasking: false
    DisableLocalAuth: false
    ForceCustomerStorageForProfiler: false
    RetentionInDays: 90
    SamplingPercentage: 100
    publicNetworkAccessForIngestion: 'Enabled'
    publicNetworkAccessForQuery: 'Enabled'
  }
}

resource smartDetectorAlertRule 'microsoft.alertsManagement/smartDetectorAlertRules@2019-06-01' = {
  name: resourceName
  location: 'global'
  properties: {
    actionGroups: {
      customEmailSubject: ''
      customWebhookPayload: ''
      groupIds: [
        actionGroup.id
      ]
    }
    description: ''
    detector: {
      id: 'FailureAnomaliesDetector'
    }
    frequency: 'PT1M'
    scope: [
      component.id
    ]
    severity: 'Sev0'
    state: 'Enabled'
  }
}

リソースの形式

microsoft.alertsManagement/smartDetectorAlertRules リソースを作成するには、次の Bicep をテンプレートに追加します。

resource symbolicname 'microsoft.alertsManagement/smartDetectorAlertRules@2021-04-01' = {
  location: 'string'
  name: 'string'
  properties: {
    actionGroups: {
      customEmailSubject: 'string'
      customWebhookPayload: 'string'
      groupIds: [
        'string'
      ]
    }
    description: 'string'
    detector: {
      id: 'string'
      parameters: {
        {customized property}: any(...)
      }
    }
    frequency: 'string'
    scope: [
      'string'
    ]
    severity: 'string'
    state: 'string'
    throttling: {
      duration: 'string'
    }
  }
  tags: {
    {customized property}: 'string'
  }
}

プロパティ値

microsoft.alertsManagement/smartDetectorAlertRules

名前 形容 価値
位置 リソースの場所。 文字列
名前 リソース名 string (必須)
プロパティ アラート ルールのプロパティ。 AlertRuleProperties の
タグ リソース タグ タグ名と値のディクショナリ。 テンプレート の タグを参照してください

アクショングループ情報

名前 形容 価値
customEmailSubject(カスタムメール件名) 電子メール通知で使用するオプションのカスタム 電子メールの件名。 文字列
カスタムウェブフックペイロード Web フック通知で使用するオプションのカスタム Web フック ペイロード。 文字列
グループID アクション グループ リソース ID。 string[] (必須)

AlertRuleProperties の

名前 形容 価値
アクショングループ アラート ルールのアクション。 ActionGroupsInformation (必須)
形容 アラート ルールの説明。 文字列
ディテクター アラート ルールの検出機能。 Detector (必須)
周波数 アラート ルールの頻度 (ISO8601形式)。 時間の細分性は分単位で、最小値は検出器に応じて 1 分である必要があります。 string (必須)
スコープ アラート ルール リソースのスコープ。 string[] (必須)
過酷 アラート ルールの重大度。 'Sev0'
「Sev1」
「Sev2」
「Sev3」
'Sev4' (必須)
状態 アラート ルールの状態。 「無効」
'Enabled' (必須)
スロットリング アラート ルールの調整情報。 スロットル情報

AzureResourceTags

名前 形容 価値

ディテクター

名前 形容 価値
身分証明書 検出 ID。 string (必須)
パラメーター 検出器のパラメーター。 DetectorParameters (検出パラメータ)

DetectorParameters (検出パラメータ)

名前 形容 価値

スロットル情報

名前 形容 価値
期間 アラート ルールに再度通知する前に待機するために必要な期間 (ISO8601形式)。 時間の細分性は分単位で、最小値は 0 分である必要があります 文字列

ARM テンプレート リソース定義

smartDetectorAlertRules リソースの種類は、次をターゲットとする操作と共にデプロイできます。

使用例

リソースの形式

microsoft.alertsManagement/smartDetectorAlertRules リソースを作成するには、次の JSON をテンプレートに追加します。

{
  "type": "microsoft.alertsManagement/smartDetectorAlertRules",
  "apiVersion": "2021-04-01",
  "name": "string",
  "location": "string",
  "properties": {
    "actionGroups": {
      "customEmailSubject": "string",
      "customWebhookPayload": "string",
      "groupIds": [ "string" ]
    },
    "description": "string",
    "detector": {
      "id": "string",
      "parameters": {
        "{customized property}": {}
      }
    },
    "frequency": "string",
    "scope": [ "string" ],
    "severity": "string",
    "state": "string",
    "throttling": {
      "duration": "string"
    }
  },
  "tags": {
    "{customized property}": "string"
  }
}

プロパティ値

microsoft.alertsManagement/smartDetectorAlertRules

名前 形容 価値
apiVersion (英語) API のバージョン '2021-04-01'
位置 リソースの場所。 文字列
名前 リソース名 string (必須)
プロパティ アラート ルールのプロパティ。 AlertRuleProperties の
タグ リソース タグ タグ名と値のディクショナリ。 テンプレート の タグを参照してください
型 リソースの種類 'microsoft.alertsManagement/smartDetectorAlertRules'

アクショングループ情報

名前 形容 価値
customEmailSubject(カスタムメール件名) 電子メール通知で使用するオプションのカスタム 電子メールの件名。 文字列
カスタムウェブフックペイロード Web フック通知で使用するオプションのカスタム Web フック ペイロード。 文字列
グループID アクション グループ リソース ID。 string[] (必須)

AlertRuleProperties の

名前 形容 価値
アクショングループ アラート ルールのアクション。 ActionGroupsInformation (必須)
形容 アラート ルールの説明。 文字列
ディテクター アラート ルールの検出機能。 Detector (必須)
周波数 アラート ルールの頻度 (ISO8601形式)。 時間の細分性は分単位で、最小値は検出器に応じて 1 分である必要があります。 string (必須)
スコープ アラート ルール リソースのスコープ。 string[] (必須)
過酷 アラート ルールの重大度。 'Sev0'
「Sev1」
「Sev2」
「Sev3」
'Sev4' (必須)
状態 アラート ルールの状態。 「無効」
'Enabled' (必須)
スロットリング アラート ルールの調整情報。 スロットル情報

AzureResourceTags

名前 形容 価値

ディテクター

名前 形容 価値
身分証明書 検出 ID。 string (必須)
パラメーター 検出器のパラメーター。 DetectorParameters (検出パラメータ)

DetectorParameters (検出パラメータ)

名前 形容 価値

スロットル情報

名前 形容 価値
期間 アラート ルールに再度通知する前に待機するために必要な期間 (ISO8601形式)。 時間の細分性は分単位で、最小値は 0 分である必要があります 文字列

Terraform (AzAPI プロバイダー) リソース定義

smartDetectorAlertRules リソースの種類は、次をターゲットとする操作と共にデプロイできます。

  • リソースグループ 各APIバージョンの変更プロパティ一覧については、 変更ログをご覧ください。

使用例

Terraformサンプル

Monitor Smart Detector Alert Ruleのデプロイの基本的な例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "actionGroup" {
  type      = "Microsoft.Insights/actionGroups@2023-01-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = "global"
  body = {
    properties = {
      armRoleReceivers = [
      ]
      automationRunbookReceivers = [
      ]
      azureAppPushReceivers = [
      ]
      azureFunctionReceivers = [
      ]
      emailReceivers = [
      ]
      enabled = true
      eventHubReceivers = [
      ]
      groupShortName = "acctestag"
      itsmReceivers = [
      ]
      logicAppReceivers = [
      ]
      smsReceivers = [
      ]
      voiceReceivers = [
      ]
      webhookReceivers = [
      ]
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "component" {
  type      = "Microsoft.Insights/components@2020-02-02"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    kind = "web"
    properties = {
      Application_Type                = "web"
      DisableIpMasking                = false
      DisableLocalAuth                = false
      ForceCustomerStorageForProfiler = false
      RetentionInDays                 = 90
      SamplingPercentage              = 100
      publicNetworkAccessForIngestion = "Enabled"
      publicNetworkAccessForQuery     = "Enabled"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

resource "azapi_resource" "smartDetectorAlertRule" {
  type      = "microsoft.alertsManagement/smartDetectorAlertRules@2019-06-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = "global"
  body = {
    properties = {
      actionGroups = {
        customEmailSubject   = ""
        customWebhookPayload = ""
        groupIds = [
          azapi_resource.actionGroup.id,
        ]
      }
      description = ""
      detector = {
        id = "FailureAnomaliesDetector"
      }
      frequency = "PT1M"
      scope = [
        azapi_resource.component.id,
      ]
      severity = "Sev0"
      state    = "Enabled"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

リソースの形式

microsoft.alertsManagement/smartDetectorAlertRules リソースを作成するには、次の Terraform をテンプレートに追加します。

resource "azapi_resource" "symbolicname" {
  type = "microsoft.alertsManagement/smartDetectorAlertRules@2021-04-01"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      actionGroups = {
        customEmailSubject = "string"
        customWebhookPayload = "string"
        groupIds = [
          "string"
        ]
      }
      description = "string"
      detector = {
        id = "string"
        parameters = {
          {customized property} = ?
        }
      }
      frequency = "string"
      scope = [
        "string"
      ]
      severity = "string"
      state = "string"
      throttling = {
        duration = "string"
      }
    }
  }
}

プロパティ値

microsoft.alertsManagement/smartDetectorAlertRules

名前 形容 価値
位置 リソースの場所。 文字列
名前 リソース名 string (必須)
プロパティ アラート ルールのプロパティ。 AlertRuleProperties の
タグ リソース タグ タグ名と値のディクショナリ。
型 リソースの種類 "microsoft.alertsManagement/smartDetectorAlertRules@2021-04-01"

アクショングループ情報

名前 形容 価値
customEmailSubject(カスタムメール件名) 電子メール通知で使用するオプションのカスタム 電子メールの件名。 文字列
カスタムウェブフックペイロード Web フック通知で使用するオプションのカスタム Web フック ペイロード。 文字列
グループID アクション グループ リソース ID。 string[] (必須)

AlertRuleProperties の

名前 形容 価値
アクショングループ アラート ルールのアクション。 ActionGroupsInformation (必須)
形容 アラート ルールの説明。 文字列
ディテクター アラート ルールの検出機能。 Detector (必須)
周波数 アラート ルールの頻度 (ISO8601形式)。 時間の細分性は分単位で、最小値は検出器に応じて 1 分である必要があります。 string (必須)
スコープ アラート ルール リソースのスコープ。 string[] (必須)
過酷 アラート ルールの重大度。 'Sev0'
「Sev1」
「Sev2」
「Sev3」
'Sev4' (必須)
状態 アラート ルールの状態。 「無効」
'Enabled' (必須)
スロットリング アラート ルールの調整情報。 スロットル情報

AzureResourceTags

名前 形容 価値

ディテクター

名前 形容 価値
身分証明書 検出 ID。 string (必須)
パラメーター 検出器のパラメーター。 DetectorParameters (検出パラメータ)

DetectorParameters (検出パラメータ)

名前 形容 価値

スロットル情報

名前 形容 価値
期間 アラート ルールに再度通知する前に待機するために必要な期間 (ISO8601形式)。 時間の細分性は分単位で、最小値は 0 分である必要があります 文字列