「すべてのリソース」というマネージド・サービスの横断で全部の作ったリソースが表として出て、簡単なフィルターが使えるものがあり、ごちゃ混ぜ感がすごくて最初驚いたけど、使ってみると思いの外すごく便利。マネージド・サービスがたくさんあるのであれ作ったやつどこだっけな?がだいぶ解消されるのと、あっこのサービスは裏でこんなの生成しているんだってのがリンクを頑張って掘って探さなくてもわかるのが嬉しい。
全く同じような話で、全部のアラートは?というアラートに絞った状態で欲しい場合がある。実はこれもあるらしい。Azure ポータル -> 左のメニューから[モニター] -> [アラート] -> [アラート ルール] -> [クエリを開く] -> [クエリの実行]
resources
| where type in~ ('microsoft.insights/metricalerts','microsoft.insights/scheduledqueryrules') and ['kind'] !in~ ('LogToMetric','LogToApplicationInsights')
| extend severity = strcat("Sev", properties["severity"])
| extend enabled = tobool(properties["enabled"])
| where enabled in~ ('true')
| project id,name,type,properties,enabled,severity,subscriptionId
| union (resources | where type =~ 'microsoft.alertsmanagement/smartdetectoralertrules' | extend severity = tostring(properties["severity"])
| extend enabled = properties["state"] =~ 'Enabled' | where enabled in~ ('true') | project id,name,type,properties,enabled,severity,subscriptionId), (resources | where type =~ 'microsoft.insights/activitylogalerts' | extend severity = "Sev4"
| extend enabled = tobool(properties["enabled"]) | mvexpand innerCondition = properties["condition"]["allOf"] | where innerCondition["field"] =~ 'category'
| where enabled in~ ('true') | project id,name,type,properties,enabled,severity,subscriptionId)
| order by tolower(name) asc