We are creating azure monitor alerts through terraform using below code. There is a field azurerm provides to customize email subject. But it never seems to work. The email subject always has something like
"Fired: Sev4 Azure Monitor Alert [alert-name] at [time]"
How to customize the email subject for Azure Monitor Alerts through terraform?
resource "azurerm_monitor_scheduled_query_rules_alert" "example" {
name = format("%s-queryrule", var.prefix)
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
action {
action_group = []
email_subject = "Email Header" // This never works !!!
}
data_source_id = azurerm_application_insights.example.id
description = "Alert when total results cross threshold"
enabled = true
query = <<-QUERY
requests
| where tolong(resultCode) >= 500
| summarize count() by bin(timestamp, 5m)
QUERY
}