It's been a pain when tracking alerts when coming across multi regions and environments. Not only wasting time to find the right resources on the Azure portal but sometime took a while to filter/load all the resources on the portal. Is there a way to embed the resources/objects URL into the metric alert's description so one can just click it on the e.g. Opsgenie and lead to the problematic resources on the Azure portal?
Example:
Take this alert message for instance:
Name: [P2]-[NA]-[prod_v1_SDL_api-async_azure_australiaeast_Commercial]-[sdl-au-prod-async-cosmosdb Cosmosdb Availability is LessThan Threshold]
Description: The availability of Async cosmosdb is less than 100%.
I want to have a link inside the Description that can lead me to the right cosmosDB on the Azure portal.
I'm looking to make the resources/objects URL into a variable then use it inside Terraform monitor_metric_alert or something similar to that. But I didn't see anything similar to what I'm looking for on Terraform monitor_metric_alert.
I tried to reproduce the same in my environment.
I think what you are looking for is
Data collection endpoints
and rules in Azure Monitor.See the steps here
Code:
snippet from azurerm_monitor_data_collection_rule | Resources | hashicorp/azurerm | Terraform Registry
Code:
#Create Log Analytics workspace with contributor rights:
Terraform apply
ran successfullyPortal view.