Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Add query for ala-1 to find subscriptions without service health aler…
Browse files Browse the repository at this point in the history
…ts (#437)
  • Loading branch information
sebassem authored Apr 4, 2024
1 parent 7dbd12b commit 3ff7e51
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
// under-development
// Azure Resource Graph Query
// This resource graph query will return all subscriptions without Service Health alerts configured.

resourcecontainers
| where type == 'microsoft.resources/subscriptions'
| project subscriptionAlerts=tostring(id),name,tags
| join kind=leftouter (
resources
| where type == 'microsoft.insights/activitylogalerts' and properties.condition contains "ServiceHealth"
| extend subscriptions = properties.scopes
| project subscriptions
| mv-expand subscriptions
| project subscriptionAlerts = tostring(subscriptions)
) on subscriptionAlerts
| where isempty(subscriptionAlerts1)
| project-away subscriptionAlerts1
| project recommendationID = "ala-1",id=subscriptionAlerts,name,tags

0 comments on commit 3ff7e51

Please sign in to comment.