次の方法で共有


共通アラート スキーマ

共通アラート スキーマを使用すると、Azure Monitor のアラート通知の使用を標準化できます。 これまでは、アクティビティ ログ、メトリック、ログ検索アラートには、それぞれ独自の電子メール テンプレートと Webhook スキーマが用意されていました。 共通アラート スキーマにより、すべてのアラート通知に対して 1 つの標準化されたスキーマが提供されます。

標準化されたスキーマを使用すると、統合の数を最小限に抑えることができます。これにより、統合の管理とメンテナンスのプロセスが簡略化されます。 共通スキーマにより、Azure portal と Azure mobile app の両方で、より優れたアラート使用エクスペリエンスを実現できます。

共通アラート スキーマにより、次の一貫性のある構造が提供されます。

  • 電子メール テンプレート: 詳細な電子メール テンプレートを使用して、問題を一目で診断します。 ポータルおよび影響を受けるリソース上のアラート インスタンスへの埋め込みリンクにより、即座に修復プロセスに移動できます。

  • JSON 構造: 一貫性のある JSON 構造を使用して、次を使用してすべてのアラートの種類の統合を構築します。

    • Azure Logic Apps
    • Azure Functions (アジュール ファンクションズ)
    • Azure Automation 作業手順書

メモ

  • VM Insights によって生成されたアラートは、共通スキーマをサポートしていません。
  • スマート検出アラートでは、既定で共通スキーマが使用されます。 スマート検出アラートに対して共通スキーマを有効にする必要はありません。

共通スキーマの構造

共通スキーマには、影響を受けるリソースと、これらのセクションのアラートの原因に関する情報が含まれています。

  • 要点: アラートの影響を受けるリソースと、重大度や説明などの一般的なアラート メタデータを記述するすべてのアラートの種類で使用される標準化されたフィールド。

    リソース グループなどの条件に基づいてアラート インスタンスを特定のチームにルーティングする場合は、[ 要点 ] セクションのフィールドを使用して、すべてのアラートの種類のルーティング ロジックを提供できます。 その後、アラート通知を受け取るチームは、調査のためにコンテキスト フィールドを使用できます。

  • アラート コンテキスト: アラートの種類によって異なるフィールド。 アラート コンテキストのフィールドは、アラートの原因を示します。 たとえば、メトリック アラートのアラート コンテキストには、メトリック名やメトリック値などのフィールドが追加されています。 アクティビティ ログ アラートの場合は、そのアラートを生成したイベントに関する情報が記載されます。

  • カスタム プロパティ: 既定ではアラート ペイロードに含まれていない追加情報は、カスタム プロパティを使用してアラート ペイロードに含めることができます。 カスタム プロパティは、アラート ルールに構成されている情報を含めることができる キーと値 のペアです。

アラートのペイロードのサンプル

{
  "schemaId": "azureMonitorCommonAlertSchema",
  "data": {
    "essentials": {
      "alertId": "/subscriptions/<subscription ID>/providers/Microsoft.AlertsManagement/alerts/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
      "alertRule": "WCUS-R2-Gen2",
      "severity": "Sev3",
      "signalType": "Metric",
      "monitorCondition": "Resolved",
      "monitoringService": "Platform",
      "alertTargetIDs": [
        "/subscriptions/<subscription ID>/resourcegroups/pipelinealertrg/providers/microsoft.compute/virtualmachines/wcus-r2-gen2"
      ],
      "configurationItems": [
        "wcus-r2-gen2"
      ],
      "originAlertId": "3f2d4487-b0fc-4125-8bd5-7ad17384221e_PipeLineAlertRG_microsoft.insights_metricAlerts_WCUS-R2-Gen2_-117781227",
      "firedDateTime": "2019-03-22T13:58:24.3713213Z",
      "resolvedDateTime": "2019-03-22T14:03:16.2246313Z",
      "description": "",
      "essentialsVersion": "1.0",
      "alertContextVersion": "1.0"
    },
    "alertContext": {
      "properties": null,
      "conditionType": "SingleResourceMultipleMetricCriteria",
      "condition": {
        "windowSize": "PT5M",
        "allOf": [
          {
            "metricName": "Percentage CPU",
            "metricNamespace": "Microsoft.Compute/virtualMachines",
            "operator": "GreaterThan",
            "threshold": "25",
            "timeAggregation": "Average",
            "dimensions": [
              {
                "name": "ResourceId",
                "value": "3efad9dc-3d50-4eac-9c87-8b3fd6f97e4e"
              }
            ],
            "metricValue": 7.727
          }
        ]
      }
    },
    "customProperties": {
      "Key1": "Value1",
      "Key2": "Value2"
    }
  }
}

共通スキーマを使用するサンプル アラートについては、 アラート ペイロードのサンプルを参照してください。

基本的なフィールド

フィールド 説明
alertId アラート インスタンスを識別する一意のリソース ID。
alertRule そのアラート インスタンスを生成したアラート ルールの名前。
重大度 アラートの重大度。 指定できる値は、Sev0、Sev1、Sev2、Sev3、または Sev4 です。
シグナルタイプ アラート ルールが定義されていたシグナルを示します。 指定できる値は、Metric、Log、または Activity Log です。
monitorCondition アラートが発生すると、アラートの監視条件は Fired に設定されます。 アラートの発生の原因となった基になる条件がクリアされると、監視条件は [解決済み] に設定されます。
モニタリングサービス アラートを生成した監視サービスまたはソリューション。 監視サービスでは、アラート コンテキスト内のフィールドが決定されます。
アラート対象ID アラートの影響を受けるターゲットである Azure Resource Manager ID の一覧。 Log Analytics ワークスペースまたは Application Insights インスタンスで定義されているログ検索アラートの場合は、それぞれのワークスペースまたはアプリケーションになります。
設定項目 アラートの影響を受けるリソースの一覧。
場合によっては、構成項目がアラート ターゲットとは異なることがあります。 たとえば、Log Analytics ワークスペースに定義された metric-for-log (つまりログ検索アラート) の場合、構成項目はデータを送信する実際のリソースであり、ワークスペースではありません。
  • ログ検索アラート API (スケジュールされたクエリ ルール) v2021-08-01 の場合、configurationItem の値は、_ResourceIdResourceIdResourceComputer という優先順位で、明示的に定義されたディメンションから取得されます。
  • 旧バージョンのログ検索アラート API の場合、configurationItem の値は、_ResourceIdResourceIdResourceComputer という優先順位で、結果から暗黙的に取得されます。
ITSM システムの場合、アラートを構成管理データベース内のリソースと関連付けるために configurationItems フィールドが使われます。
originAlertId 生成元の監視サービスによって生成された、アラート インスタンスの ID。
firedDateTime アラート インスタンスが発生した日時 (協定世界時 (UTC))。
resolvedDateTime アラート インスタンスの監視条件が UTC で解決済みに設定 されている 日時。 現在はメトリック アラートに対してのみ適用されます。
説明 アラート ルールで定義されている説明。
alertRuleID そのアラート インスタンスを生成したアラート ルールの ID。
リソースタイプ そのアラートの影響を受けるリソースの種類。
リソースグループ名 影響を受けるリソースのリソース グループの名前。
essentialsVersion essentials セクションのバージョン番号。
alertContextVersion alertContext セクションのバージョン番号。
investigationLink Azure Monitor でアラートを調査するためのリンク。 現時点では、限定プレビュー登録が必要です。

メトリック アラートのアラート コンテキスト フィールド

フィールド 説明
プロパティ (省略可能。) 顧客定義のプロパティのコレクション。
条件タイプ アラート ルールに対して選択された条件の種類:
  • 静的しきい値
  • 動的しきい値
  • ウェブテスト
条件
ウィンドウサイズ アラート ルールによって分析された期間。
allOf アラートをトリガーするために、アラート ルールで定義されたすべての条件が満たされている必要があることを示します。
alertSensitivity 動的しきい値を持つアラート ルールの場合、ルールの機密性、または値が上限または下限のしきい値からどれだけ逸脱できるかを示します。
failingPeriods 動的しきい値を持つアラート ルールの場合、アラートをトリガーするアラートのしきい値を満たしていない評価期間の数。 たとえば、過去 5 回の評価期間のうち 3 回がアラートのしきい値内にない場合にアラートがトリガーされるよう示すことができます。
評価期間の数 評価の合計数。
minFailingPeriodsToAlert アラート ルールの条件を満たさない評価の最小数。
ignoreDataBefore(指定時点より前のデータを無視) (省略可能。) 動的しきい値を持つアラート ルールの場合、しきい値の計算が開始される日付。 この値を使用して、指定した日付より前のデータを使用してルールで動的しきい値が計算されないように指定します。
metricName アラート ルールで監視するメトリックの名前。
メトリック名前空間 アラート ルールで監視するメトリックの名前空間。
オペレーター アラート ルールの論理演算子。
閾値 アラート ルールで定義されているしきい値。 動的しきい値を持つアラート ルールの場合、この値は計算されたしきい値です。
timeAggregation アラート ルールの集計の種類。
dimensions アラートをトリガーしたメトリック ディメンション。
名前 ディメンション名。
価値 ディメンション値。
metricValue しきい値に違反した時点のメトリック値。
webTestName 条件の種類が webtest の場合は、Web テストの名前。
ウィンドウ開始時刻 アラートが発生した評価ウィンドウの開始時刻。
ウィンドウ終了時間 アラートが発生した評価ウィンドウの終了日時。

monitoringService = Platform の場合に静的しきい値を持つメトリック アラートのサンプル

{
  "alertContext": {
      "properties": null,
      "conditionType": "SingleResourceMultipleMetricCriteria",
      "condition": {
        "windowSize": "PT5M",
        "allOf": [
          {
            "metricName": "Percentage CPU",
            "metricNamespace": "Microsoft.Compute/virtualMachines",
            "operator": "GreaterThan",
            "threshold": "25",
            "timeAggregation": "Average",
            "dimensions": [
              {
                "name": "ResourceId",
                "value": "3efad9dc-3d50-4eac-9c87-8b3fd6f97e4e"
              }
            ],
            "metricValue": 31.1105
          }
        ],
        "windowStartTime": "2019-03-22T13:40:03.064Z",
        "windowEndTime": "2019-03-22T13:45:03.064Z"
      }
    }
}

monitoringService = Platform の場合に動的しきい値を持つメトリック アラートのサンプル

{
  "alertContext": {
      "properties": null,
      "conditionType": "DynamicThresholdCriteria",
      "condition": {
        "windowSize": "PT5M",
        "allOf": [
          {
            "alertSensitivity": "High",
            "failingPeriods": {
              "numberOfEvaluationPeriods": 1,
              "minFailingPeriodsToAlert": 1
            },
            "ignoreDataBefore": null,
            "metricName": "Egress",
            "metricNamespace": "microsoft.storage/storageaccounts",
            "operator": "GreaterThan",
            "threshold": "47658",
            "timeAggregation": "Total",
            "dimensions": [],
            "metricValue": 50101
          }
        ],
        "windowStartTime": "2021-07-20T05:07:26.363Z",
        "windowEndTime": "2021-07-20T05:12:26.363Z"
      }
    }
}

monitoringService = Platform の場合の可用性テストにおけるメトリック アラートのサンプル

{
  "alertContext": {
      "properties": null,
      "conditionType": "WebtestLocationAvailabilityCriteria",
      "condition": {
        "windowSize": "PT5M",
        "allOf": [
          {
            "metricName": "Failed Location",
            "metricNamespace": null,
            "operator": "GreaterThan",
            "threshold": "2",
            "timeAggregation": "Sum",
            "dimensions": [],
            "metricValue": 5,
            "webTestName": "myAvailabilityTest-myApplication"
          }
        ],
        "windowStartTime": "2019-03-22T13:40:03.064Z",
        "windowEndTime": "2019-03-22T13:45:03.064Z"
      }
    }
}

ログ検索アラートのアラート コンテキスト フィールド

メモ

共通スキーマを有効にすると、ペイロード内のフィールドが共通スキーマのフィールドにリセットされます。 そのため、ログ検索アラートには、共通スキーマに関して次の制限があります。

  • 共通スキーマによってカスタム構成が上書きされるため、カスタムのメールの件名や JSON ペイロードのある Webhook を使用したログ検索アラートでは、共通スキーマはサポートされません。

  • 共通スキーマを使用するアラートには、アラートごとに 256 KB の上限サイズがあります。 ログ検索アラート ペイロードに、アラートの最大サイズを超える検索結果が含まれている場合、検索結果はログ検索アラート ペイロードに埋め込まれません。 IncludedSearchResults フラグにより、ペイロードに検索結果が含まれているかどうかを確認できます。 検索結果が含まれていない場合は、 LinkToFilteredSearchResultsAPI または LinkToSearchResultsAPI を使用して Log Analytics API を使用してクエリ結果にアクセスします。

フィールド 説明
検索クエリ アラート ルールで定義されているクエリ。
SearchIntervalStartTimeUtc アラートが発生した評価ウィンドウの開始時刻 (UTC)。
SearchIntervalEndTimeUtc (検索間隔終了時刻UTC) アラートが発生した評価ウィンドウの終了時刻 (UTC)。
ResultCount クエリによって返されるレコードの数。 メトリック測定ルールの場合、特定のディメンションの組み合わせに一致する数またはレコード。
検索結果へのリンク 検索結果へのリンク。
フィルタリングされた検索結果UIへのリンク メトリック測定ルールの場合、ディメンションの組み合わせによってフィルター処理された後の検索結果へのリンク。
LinkToSearchResultsAPI (検索結果APIへのリンク) Log Analytics API を使用したクエリ結果へのリンク。
LinkToFilteredSearchResultsAPI メトリック測定ルールの場合、ディメンションの組み合わせによってフィルター処理された後の Log Analytics API を使用した検索結果へのリンク。
検索間隔の持続時間(分) 検索間隔の合計分数。
SearchIntervalInMin 検索間隔の合計分数。
しきい値 アラート ルールで定義されているしきい値。
オペレーター アラート ルールで定義されている演算子。
ApplicationID アラートがトリガーされた Application Insights ID。
ディメンション メトリック測定ルールの場合、アラートがトリガーされたメトリック ディメンション。
名前 ディメンション名。
価値 ディメンション値。
検索結果 完全な検索結果。
テーブル / 表 検索結果の結果のテーブル。
名前 検索結果のテーブルの名前。
テーブル内の列。
名前 列の名前。
type 列の型。
rows テーブル内の行。
データソース アラートがトリガーされたデータ ソース。
リソースID アラートの影響を受けるリソース ID。
tables クエリに含まれる下書き応答テーブル。
含まれている検索結果 ペイロードに結果を含める必要があるかどうかを示すフラグ。
アラートタイプ アラートの種類:
- メトリック測定
- 結果の数

monitoringService = Log Analytics の場合のログ検索アラートのサンプル

{
  "alertContext": {
    "SearchQuery": "Perf | where ObjectName == \"Processor\" and CounterName == \"% Processor Time\" | summarize AggregatedValue = avg(CounterValue) by bin(TimeGenerated, 5m), Computer",
    "SearchIntervalStartTimeUtc": "3/22/2019 1:36:31 PM",
    "SearchIntervalEndtimeUtc": "3/22/2019 1:51:31 PM",
    "ResultCount": 2,
    "LinkToSearchResults": "https://portal.azure.com/#Analyticsblade/search/index?_timeInterval.intervalEnd=2018-03-26T09%3a10%3a40.0000000Z&_timeInterval.intervalDuration=3600&q=Usage",
    "LinkToFilteredSearchResultsUI": "https://portal.azure.com/#Analyticsblade/search/index?_timeInterval.intervalEnd=2018-03-26T09%3a10%3a40.0000000Z&_timeInterval.intervalDuration=3600&q=Usage",
    "LinkToSearchResultsAPI": "https://api.loganalytics.io/v1/workspaces/workspaceID/query?query=Heartbeat&timespan=2020-05-07T18%3a11%3a51.0000000Z%2f2020-05-07T18%3a16%3a51.0000000Z",
    "LinkToFilteredSearchResultsAPI": "https://api.loganalytics.io/v1/workspaces/workspaceID/query?query=Heartbeat&timespan=2020-05-07T18%3a11%3a51.0000000Z%2f2020-05-07T18%3a16%3a51.0000000Z",
    "SeverityDescription": "Warning",
    "WorkspaceId": "12345a-1234b-123c-123d-12345678e",
    "SearchIntervalDurationMin": "15",
    "AffectedConfigurationItems": [
      "INC-Gen2Alert"
    ],
    "SearchIntervalInMinutes": "15",
    "Threshold": 10000,
    "Operator": "Less Than",
    "Dimensions": [
      {
        "name": "Computer",
        "value": "INC-Gen2Alert"
      }
    ],
    "SearchResults": {
      "tables": [
        {
          "name": "PrimaryResult",
          "columns": [
            {
              "name": "$table",
              "type": "string"
            },
            {
              "name": "Computer",
              "type": "string"
            },
            {
              "name": "TimeGenerated",
              "type": "datetime"
            }
          ],
          "rows": [
            [
              "Fabrikam",
              "33446677a",
              "2018-02-02T15:03:12.18Z"
            ],
            [
              "Contoso",
              "33445566b",
              "2018-02-02T15:16:53.932Z"
            ]
          ]
        }
      ],
      "dataSources": [
        {
          "resourceId": "/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/resourcegroups/test/providers/microsoft.operationalinsights/workspaces/test",
          "tables": [
            "Heartbeat"
          ]
        }
      ]
    },
    "IncludedSearchResults": "True",
    "AlertType": "Metric measurement"
  }
}

monitoringService = Application Insights の場合のログ検索アラートのサンプル

{
  "alertContext": {
    "SearchQuery": "requests | where resultCode == \"500\" | summarize AggregatedValue = Count by bin(Timestamp, 5m), IP",
    "SearchIntervalStartTimeUtc": "3/22/2019 1:36:33 PM",
    "SearchIntervalEndtimeUtc": "3/22/2019 1:51:33 PM",
    "ResultCount": 2,
    "LinkToSearchResults": "https://portal.azure.com/AnalyticsBlade/subscriptions/12345a-1234b-123c-123d-12345678e/?query=search+*+&timeInterval.intervalEnd=2018-03-26T09%3a10%3a40.0000000Z&_timeInterval.intervalDuration=3600&q=Usage",
    "LinkToFilteredSearchResultsUI": "https://portal.azure.com/AnalyticsBlade/subscriptions/12345a-1234b-123c-123d-12345678e/?query=search+*+&timeInterval.intervalEnd=2018-03-26T09%3a10%3a40.0000000Z&_timeInterval.intervalDuration=3600&q=Usage",
    "LinkToSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/0MyAppId0/metrics/requests/count",
    "LinkToFilteredSearchResultsAPI": "https://api.applicationinsights.io/v1/apps/0MyAppId0/metrics/requests/count",
    "SearchIntervalDurationMin": "15",
    "SearchIntervalInMinutes": "15",
    "Threshold": 10000.0,
    "Operator": "Less Than",
    "ApplicationId": "00001111-aaaa-2222-bbbb-3333cccc4444",
    "Dimensions": [
      {
        "name": "IP",
        "value": "1.1.1.1"
      }
    ],
    "SearchResults": {
      "tables": [
        {
          "name": "PrimaryResult",
          "columns": [
            {
              "name": "$table",
              "type": "string"
            },
            {
              "name": "Id",
              "type": "string"
            },
            {
              "name": "Timestamp",
              "type": "datetime"
            }
          ],
          "rows": [
            [
              "Fabrikam",
              "33446677a",
              "2018-02-02T15:03:12.18Z"
            ],
            [
              "Contoso",
              "33445566b",
              "2018-02-02T15:16:53.932Z"
            ]
          ]
        }
      ],
      "dataSources": [
        {
          "resourceId": "/subscriptions/cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a/resourcegroups/test/providers/microsoft.operationalinsights/workspaces/test",
          "tables": [
            "Heartbeat"
          ]
        }
      ]
    },
    "IncludedSearchResults": "True",
    "AlertType": "Metric measurement"
  }
}

monitoringService = Log Alerts V2 の場合のログ検索アラートのサンプル

メモ

API バージョン 2020-05-01 のログ検索アラート ルールでは、共通スキーマのみをサポートするこのペイロードの種類が使用されます。 このバージョンを使用している場合、検索結果はログ検索アラート ペイロードに埋め込まれません。 ディメンションを使用して、発生したアラートにコンテキストを提供します。 LinkToFilteredSearchResultsAPIまたはLinkToSearchResultsAPIを使用して、Log Analytics API を使用してクエリ結果にアクセスすることもできます。 結果を埋め込む必要がある場合は、指定されたリンクでロジック アプリを使用して、カスタム ペイロードを生成します。

{
  "alertContext": {
    "properties": {
      "name1": "value1",
      "name2": "value2"
    },
    "conditionType": "LogQueryCriteria",
    "condition": {
      "windowSize": "PT10M",
      "allOf": [
        {
          "searchQuery": "Heartbeat",
          "metricMeasureColumn": "CounterValue",
          "targetResourceTypes": "['Microsoft.Compute/virtualMachines']",
          "operator": "LowerThan",
          "threshold": "1",
          "timeAggregation": "Count",
          "dimensions": [
            {
              "name": "Computer",
              "value": "TestComputer"
            }
          ],
          "metricValue": 0.0,
          "failingPeriods": {
            "numberOfEvaluationPeriods": 1,
            "minFailingPeriodsToAlert": 1
          },
          "linkToSearchResultsUI": "https://portal.azure.com#@12345a-1234b-123c-123d-12345678e/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%212345a-1234b-123c-123d-12345678e%2FresourceGroups%2FContoso%2Fproviders%2FMicrosoft.Compute%2FvirtualMachines%2FContoso%22%7D%5D%7D/q/eJzzSE0sKklKTSypUSjPSC1KVQjJzE11T81LLUosSU1RSEotKU9NzdNIAfJKgDIaRgZGBroG5roGliGGxlYmJlbGJnoGEKCpp4dDmSmKMk0A/prettify/1/timespan/2020-07-07T13%3a54%3a34.0000000Z%2f2020-07-09T13%3a54%3a34.0000000Z",
          "linkToFilteredSearchResultsUI": "https://portal.azure.com#@12345a-1234b-123c-123d-12345678e/blade/Microsoft_Azure_Monitoring_Logs/LogsBlade/source/Alerts.EmailLinks/scope/%7B%22resources%22%3A%5B%7B%22resourceId%22%3A%22%2Fsubscriptions%212345a-1234b-123c-123d-12345678e%2FresourceGroups%2FContoso%2Fproviders%2FMicrosoft.Compute%2FvirtualMachines%2FContoso%22%7D%5D%7D/q/eJzzSE0sKklKTSypUSjPSC1KVQjJzE11T81LLUosSU1RSEotKU9NzdNIAfJKgDIaRgZGBroG5roGliGGxlYmJlbGJnoGEKCpp4dDmSmKMk0A/prettify/1/timespan/2020-07-07T13%3a54%3a34.0000000Z%2f2020-07-09T13%3a54%3a34.0000000Z",
          "linkToSearchResultsAPI": "https://api.loganalytics.io/v1/subscriptions/12345a-1234b-123c-123d-12345678e/resourceGroups/Contoso/providers/Microsoft.Compute/virtualMachines/Contoso/query?query=Heartbeat%7C%20where%20TimeGenerated%20between%28datetime%282020-07-09T13%3A44%3A34.0000000%29..datetime%282020-07-09T13%3A54%3A34.0000000%29%29&timespan=2020-07-07T13%3a54%3a34.0000000Z%2f2020-07-09T13%3a54%3a34.0000000Z",
          "linkToFilteredSearchResultsAPI": "https://api.loganalytics.io/v1/subscriptions/12345a-1234b-123c-123d-12345678e/resourceGroups/Contoso/providers/Microsoft.Compute/virtualMachines/Contoso/query?query=Heartbeat%7C%20where%20TimeGenerated%20between%28datetime%282020-07-09T13%3A44%3A34.0000000%29..datetime%282020-07-09T13%3A54%3A34.0000000%29%29&timespan=2020-07-07T13%3a54%3a34.0000000Z%2f2020-07-09T13%3a54%3a34.0000000Z"
        }
      ],
      "windowStartTime": "2020-07-07T13:54:34Z",
      "windowEndTime": "2020-07-09T13:54:34Z"
    }
  }
}

アクティビティ ログ アラートのアラート コンテキスト フィールド

アクティビティ ログ アラートのフィールドの詳細については、 Azure アクティビティ ログ イベント スキーマ を参照してください。

monitoringService = Activity Log - Administrative の場合のアクティビティ ログ アラートのサンプル

{
  "alertContext": {
      "authorization": {
        "action": "Microsoft.Compute/virtualMachines/restart/action",
        "scope": "/subscriptions/<subscription ID>/resourceGroups/PipeLineAlertRG/providers/Microsoft.Compute/virtualMachines/WCUS-R2-ActLog"
      },
      "channels": "Operation",
      "claims": "{\"aud\":\"https://management.core.windows.net/\",\"iss\":\"https://sts.windows.net/12345a-1234b-123c-123d-12345678e/\",\"iat\":\"1553260826\",\"nbf\":\"1553260826\",\"exp\":\"1553264726\",\"aio\":\"42JgYNjdt+rr+3j/dx68v018XhuFAwA=\",\"appid\":\"11112222-bbbb-3333-cccc-4444dddd5555\",\"appidacr\":\"2\",\"http://schemas.microsoft.com/identity/claims/identityprovider\":\"https://sts.windows.net/12345a-1234b-123c-123d-12345678e/\",\"http://schemas.microsoft.com/identity/claims/objectidentifier\":\"22223333-cccc-4444-dddd-5555eeee6666\",\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\":\"22223333-cccc-4444-dddd-5555eeee6666\",\"http://schemas.microsoft.com/identity/claims/tenantid\":\"12345a-1234b-123c-123d-12345678e\",\"uti\":\"v5wYC9t9ekuA2rkZSVZbAA\",\"ver\":\"1.0\"}",
      "caller": "22223333-cccc-4444-dddd-5555eeee6666",
      "correlationId": "aaaa0000-bb11-2222-33cc-444444dddddd",
      "eventSource": "Administrative",
      "eventTimestamp": "2019-03-22T13:56:31.2917159+00:00",
      "eventDataId": "161fda7e-1cb4-4bc5-9c90-857c55a8f57b",
      "level": "Informational",
      "operationName": "Microsoft.Compute/virtualMachines/restart/action",
      "operationId": "310db69b-690f-436b-b740-6103ab6b0cba",
      "status": "Succeeded",
      "subStatus": "",
      "submissionTimestamp": "2019-03-22T13:56:54.067593+00:00"
    }
}

monitoringService = Activity Log - Policy の場合のアクティビティ ログ アラートのサンプル

{
  "alertContext": {
    "authorization": {
      "action": "Microsoft.Resources/checkPolicyCompliance/read",
      "scope": "/subscriptions/<GUID>"
    },
    "channels": "Operation",
    "claims": "{\"aud\":\"https://management.azure.com/\",\"iss\":\"https://sts.windows.net/<GUID>/\",\"iat\":\"1566711059\",\"nbf\":\"1566711059\",\"exp\":\"1566740159\",\"aio\":\"42FgYOhynHNw0scy3T/bL71+xLyqEwA=\",\"appid\":\"<GUID>\",\"appidacr\":\"2\",\"http://schemas.microsoft.com/identity/claims/identityprovider\":\"https://sts.windows.net/<GUID>/\",\"http://schemas.microsoft.com/identity/claims/objectidentifier\":\"<GUID>\",\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier\":\"<GUID>\",\"http://schemas.microsoft.com/identity/claims/tenantid\":\"<GUID>\",\"uti\":\"Miy1GzoAG0Scu_l3m1aIAA\",\"ver\":\"1.0\"}",
    "caller": "<GUID>",
    "correlationId": "<GUID>",
    "eventSource": "Policy",
    "eventTimestamp": "2019-08-25T11:11:34.2269098+00:00",
    "eventDataId": "<GUID>",
    "level": "Warning",
    "operationName": "Microsoft.Authorization/policies/audit/action",
    "operationId": "<GUID>",
    "properties": {
      "isComplianceCheck": "True",
      "resourceLocation": "eastus2",
      "ancestors": "<GUID>",
      "policies": "[{\"policyDefinitionId\":\"/providers/Microsoft.Authorization/policyDefinitions/<GUID>/\",\"policySetDefinitionId\":\"/providers/Microsoft.Authorization/policySetDefinitions/<GUID>/\",\"policyDefinitionReferenceId\":\"vulnerabilityAssessmentMonitoring\",\"policySetDefinitionName\":\"<GUID>\",\"policyDefinitionName\":\"<GUID>\",\"policyDefinitionEffect\":\"AuditIfNotExists\",\"policyAssignmentId\":\"/subscriptions/<GUID>/providers/Microsoft.Authorization/policyAssignments/SecurityCenterBuiltIn/\",\"policyAssignmentName\":\"SecurityCenterBuiltIn\",\"policyAssignmentScope\":\"/subscriptions/<GUID>\",\"policyAssignmentSku\":{\"name\":\"A1\",\"tier\":\"Standard\"},\"policyAssignmentParameters\":{}}]"
    },
    "status": "Succeeded",
    "subStatus": "",
    "submissionTimestamp": "2019-08-25T11:12:46.1557298+00:00"
  }
}

monitoringService = Activity Log - Autoscale の場合のアクティビティ ログ アラートのサンプル

{
  "alertContext": {
    "channels": "Admin, Operation",
    "claims": "{\"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn\":\"Microsoft.Insights/autoscaleSettings\"}",
    "caller": "Microsoft.Insights/autoscaleSettings",
    "correlationId": "<GUID>",
    "eventSource": "Autoscale",
    "eventTimestamp": "2019-08-21T16:17:47.1551167+00:00",
    "eventDataId": "<GUID>",
    "level": "Informational",
    "operationName": "Microsoft.Insights/AutoscaleSettings/Scaleup/Action",
    "operationId": "<GUID>",
    "properties": {
      "description": "The autoscale engine attempting to scale resource '/subscriptions/d<GUID>/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachineScaleSets/testVMSS' from 9 instances count to 10 instances count.",
      "resourceName": "/subscriptions/<GUID>/resourceGroups/voiceassistancedemo/providers/Microsoft.Compute/virtualMachineScaleSets/alexademo",
      "oldInstancesCount": "9",
      "newInstancesCount": "10",
      "activeAutoscaleProfile": "{\r\n  \"Name\": \"Auto created scale condition\",\r\n  \"Capacity\": {\r\n    \"Minimum\": \"1\",\r\n    \"Maximum\": \"10\",\r\n    \"Default\": \"1\"\r\n  },\r\n  \"Rules\": [\r\n    {\r\n      \"MetricTrigger\": {\r\n        \"Name\": \"Percentage CPU\",\r\n        \"Namespace\": \"microsoft.compute/virtualmachinescalesets\",\r\n        \"Resource\": \"/subscriptions/<GUID>/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachineScaleSets/testVMSS\",\r\n        \"ResourceLocation\": \"eastus\",\r\n        \"TimeGrain\": \"PT1M\",\r\n        \"Statistic\": \"Average\",\r\n        \"TimeWindow\": \"PT5M\",\r\n        \"TimeAggregation\": \"Average\",\r\n        \"Operator\": \"GreaterThan\",\r\n        \"Threshold\": 0.0,\r\n        \"Source\": \"/subscriptions/<GUID>/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachineScaleSets/testVMSS\",\r\n        \"MetricType\": \"MDM\",\r\n        \"Dimensions\": [],\r\n        \"DividePerInstance\": false\r\n      },\r\n      \"ScaleAction\": {\r\n        \"Direction\": \"Increase\",\r\n        \"Type\": \"ChangeCount\",\r\n        \"Value\": \"1\",\r\n        \"Cooldown\": \"PT1M\"\r\n      }\r\n    }\r\n  ]\r\n}",
      "lastScaleActionTime": "Wed, 21 Aug 2019 16:17:47 GMT"
    },
    "status": "Succeeded",
    "submissionTimestamp": "2019-08-21T16:17:47.2410185+00:00"
  }
}

monitoringService = Activity Log - Security の場合のアクティビティ ログ アラートのサンプル

{
  "alertContext": {
    "channels": "Operation",
    "correlationId": "<GUID>",
    "eventSource": "Security",
    "eventTimestamp": "2019-08-26T08:34:14+00:00",
    "eventDataId": "<GUID>",
    "level": "Informational",
    "operationName": "Microsoft.Security/locations/alerts/activate/action",
    "operationId": "<GUID>",
    "properties": {
      "threatStatus": "Quarantined",
      "category": "Virus",
      "threatID": "2147519003",
      "filePath": "C:\\AlertGeneration\\test.eicar",
      "protectionType": "Windows Defender",
      "actionTaken": "Blocked",
      "resourceType": "Virtual Machine",
      "severity": "Low",
      "compromisedEntity": "testVM",
      "remediationSteps": "[\"No user action is necessary\"]",
      "attackedResourceType": "Virtual Machine"
    },
    "status": "Active",
    "submissionTimestamp": "2019-08-26T09:28:58.3019107+00:00"
  }
}

monitoringService = ServiceHealth の場合のアクティビティ ログ アラートのサンプル

{
  "alertContext": {
    "authorization": null,
    "channels": 1,
    "claims": null,
    "caller": null,
    "correlationId": "bbbb1111-cc22-3333-44dd-555555eeeeee",
    "eventSource": "ServiceHealth,
    "eventTimestamp": "2019-06-24T11:31:19.0312699+00:00",
    "httpRequest": null,
    "eventDataId": "<GUID>",
    "level": "Informational",
    "operationName": "Microsoft.ServiceHealth/maintenance/action",
    "operationId": "<GUID>",
    "properties": {
      "title": "Azure Synapse Analytics Scheduled Maintenance Pending",
      "service": "Azure Synapse Analytics",
      "region": "East US",
      "communication": "<MESSAGE>",
      "incidentType": "Maintenance",
      "trackingId": "<GUID>",
      "impactStartTime": "2019-06-26T04:00:00Z",
      "impactMitigationTime": "2019-06-26T12:00:00Z",
      "impactedServices": "[{\"ImpactedRegions\":[{\"RegionName\":\"East US\"}],\"ServiceName\":\"Azure Synapse Analytics\"}]",
      "impactedServicesTableRows": "<tr>\r\n<td align='center' style='padding: 5px 10px; border-right:1px solid black; border-bottom:1px solid black'>Azure Synapse Analytics</td>\r\n<td align='center' style='padding: 5px 10px; border-bottom:1px solid black'>East US<br></td>\r\n</tr>\r\n",
      "defaultLanguageTitle": "Azure Synapse Analytics Scheduled Maintenance Pending",
      "defaultLanguageContent": "<MESSAGE>",
      "stage": "Planned",
      "communicationId": "<GUID>",
      "maintenanceId": "<GUID>",
      "isHIR": "false",
      "version": "0.1.1"
    },
    "status": "Active",
    "subStatus": null,
    "submissionTimestamp": "2019-06-24T11:31:31.7147357+00:00",
    "ResourceType": null
  }
}

monitoringService = ResourceHealth の場合のアクティビティ ログ アラートのサンプル

{
  "alertContext": {
    "channels": "Admin, Operation",
    "correlationId": "<GUID>",
    "eventSource": "ResourceHealth",
    "eventTimestamp": "2019-06-24T15:42:54.074+00:00",
    "eventDataId": "<GUID>",
    "level": "Informational",
    "operationName": "Microsoft.Resourcehealth/healthevent/Activated/action",
    "operationId": "<GUID>",
    "properties": {
      "title": "This virtual machine is stopping and deallocating as requested by an authorized user or process",
      "details": null,
      "currentHealthStatus": "Unavailable",
      "previousHealthStatus": "Available",
      "type": "Downtime",
      "cause": "UserInitiated"
    },
    "status": "Active",
    "submissionTimestamp": "2019-06-24T15:45:20.4488186+00:00"
  }
}

Prometheus アラートのコンテキスト フィールド

Prometheus アラートのフィールドの詳細については、 Prometheus ルール グループの Azure Monitor マネージド サービス を参照してください。

Prometheus アラートのサンプル

{
  "alertContext": {
    "interval": "PT1M",
    "expression": "sql_up > 0",
    "expressionValue": "0",
    "for": "PT2M",
    "labels": {
      "Environment": "Prod",
      "cluster": "myCluster1"
    },
    "annotations": {
      "summary": "alert on SQL availability"
    },
    "ruleGroup": "/subscriptions/<subscription ID>/resourceGroups/myResourceGroup/providers/Microsoft.AlertsManagement/prometheusRuleGroups/myRuleGroup"
  }
}

カスタム プロパティ フィールド

アラートを生成したアラート ルールにアクション グループが含まれている場合は、カスタム プロパティにアラートに関する追加情報を含めることができます。 カスタム プロパティ セクションには、webhook 通知に追加される "key: value" オブジェクトが含まれています。

アラート ルールでカスタム プロパティが設定されていない場合、フィールドは null です。

共通アラート スキーマを有効にする

Azure portal でアクション グループを使用するか、REST API を使用して共通アラート スキーマを有効にします。 スキーマは、アクション レベルで定義されます。 たとえば、電子メール アクションと Webhook アクションに対して個別にスキーマを有効にする必要があります。

Azure portal で共通スキーマを有効にする

一般的なアラート スキーマのオプトインを示すスクリーンショット。

  1. アクション グループで既存のアクションまたは新規のアクションを開きます。
  2. 共通アラート スキーマを有効にするには、[ はい ] を選択します。

REST API を使用して共通スキーマを有効にする

アクション グループ API を使用して、共通アラート スキーマをオプトインすることもできます。 REST API の 作成または更新 の呼び出しで、次の手順を実行します。

  • "useCommonAlertSchema" フラグを true に設定して共通スキーマを有効にします。
  • "useCommonAlertSchema" フラグを false に設定して、電子メール、webhook、Logic Apps、Azure Functions、または Automation Runbook のアクションに非共通スキーマを使用します。

共通スキーマを使用するための REST API 呼び出しのサンプル

次の REST API の作成または更新 要求:

  • 電子メール アクション "John Doe's email" に対して共通アラート スキーマを有効にします。
  • 電子メール アクション "Jane Smith's email" に対して共通アラート スキーマを無効にします。
  • Webhook アクション "Sample webhook" に対して共通アラート スキーマを有効にします。
{
  "properties": {
    "groupShortName": "sample",
    "enabled": true,
    "emailReceivers": [
      {
        "name": "John Doe's email",
        "emailAddress": "johndoe@email.com",
        "useCommonAlertSchema": true
      },
      {
        "name": "Jane Smith's email",
        "emailAddress": "janesmith@email.com",
        "useCommonAlertSchema": false
      }
    ],
    "smsReceivers": [
      {
        "name": "John Doe's mobile",
        "countryCode": "1",
        "phoneNumber": "1234567890"
      },
      {
        "name": "Jane Smith's mobile",
        "countryCode": "1",
        "phoneNumber": "0987654321"
      }
    ],
    "webhookReceivers": [
      {
        "name": "Sample webhook",
        "serviceUri": "http://www.example.com/webhook",
        "useCommonAlertSchema": true
      }
    ]
  },
  "location": "Global",
  "tags": {}
}

次のステップ