0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Azure のアクショングループに紐づいているメトリクスアラートを列挙する

Last updated at Posted at 2025-02-14

Azure のアクショングループが無邪気にたくさん作られてしまっていて整理したいのだが、Azure Portal の UI からは「このアクショングループがどこで使われているか」を見ることができない。

そういうときは Azure Resource Graph Explorer から KQL クエリを実行することで紐づいているリソースを列挙することができる。

resources
| where type =~ 'microsoft.insights/actiongroups'
| project actionGroupId = tolower(id), actionGroupName = name
| join kind=leftouter (
    resources
    | where type =~ 'microsoft.insights/metricalerts'
    | mv-expand properties['actions']
    | project actionGroupId = tolower(tostring(properties_actions['actionGroupId'])), metricAlertId = id, metricAlertName = name
) on actionGroupId
| project actionGroupId, actionGroupName, metricAlertId, metricAlertName

上記例ではアクショングループに紐づいているメトリクスアラート一覧を列挙したが、メトリクスアラート以外でアクショングループが使用されている場合は表示されないので注意されたい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?