Skip to content

Instantly share code, notes, and snippets.

@oulman
Last active October 7, 2022 20:35
Show Gist options
  • Save oulman/45f24746aaac8190c90ce6904f77ce07 to your computer and use it in GitHub Desktop.
Save oulman/45f24746aaac8190c90ce6904f77ce07 to your computer and use it in GitHub Desktop.
canonical list of azurerm terraform monitor_activity_log_alert service_health services

In PR #19878 the AzureRM monitor_activity_log_alert resource added support for granular service_health definitions. Outside of the UI, there is no obvious way of getting a list of inputs for the services parameter. The Azure portal uses an undocumented (AFAICT) API in the Microsoft.ResourceHealth provider to list supported services.

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_activity_log_alert#services

➜  az rest --method GET --url https://management.azure.com/providers/Microsoft.ResourceHealth/metadata/supportedServices/\?api-version\=2018-07-01 | jq '.properties.supportedValues[] .displayName'
"API Management"
"Action Groups"
"Activity Logs & Alerts"
"Advisor"
"Alerts"
<snip>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment