Implementing custom alerts for Azure infrastructure
Collecting logs is one of the crucial points when it comes to managing Azure infrastructure, but logs alone won’t help us when there’s an outage or some resources don’t work as expected. Of course, logs may help us in finding the root cause, but they’re not meant for proactive monitoring of infrastructure. To be notified about anomalies or abnormal behavior of Azure services, we need to implement alerts. Let’s see what steps are needed to do that.
Defining an alert
Alerts are part of Azure Monitor and are based on logs reported by services. Each alert consists of three components:
- Scope
- Condition
- Action
Alerts react when a condition is met and perform an action. We’ll describe those components in the next few sections.
The scope of an alert
Each alert can be scoped to one of the available scopes:
- Subscription
- Resource group
- Resource