In this article

Have a classic metric alert notify a non-Azure system using a webhook

In this article

You can use webhooks to route an Azure alert notification to other systems for post-processing or custom actions. You can use a webhook on an alert to route it to services that send SMS messages, to log bugs, to notify a team via chat or messaging services, or for various other actions.

This article describes how to set a webhook on an Azure metric alert. It also shows you what the payload for the HTTP POST to a webhook looks like. For information about the setup and schema for an Azure activity log alert (alert on events), see Call a webhook on an Azure activity log alert.

Azure alerts use HTTP POST to send the alert contents in JSON format to a webhook URI that you provide when you create the alert. The schema is defined later in this article. The URI must be a valid HTTP or HTTPS endpoint. Azure posts one entry per request when an alert is activated.

Configure webhooks via the Azure portal

To add or update the webhook URI, in the Azure portal, go to Create/Update Alerts.

Two types of alerts are supported: metric and event. Metric alerts are based on a metric condition. Event alerts are based on an event in the activity log. Use this value to check whether the alert is based on a metric or on an event.

The period of time that's used to monitor alert activity based on the threshold. The value must be between 5 minutes and 1 day. The value must be in ISO 8601 duration format.

timeAggregation

For metric alerts

Average, Last, Maximum, Minimum, None, Total

How the data that's collected should be combined over time. The default value is Average. See allowed values.

operator

For metric alerts

The operator that's used to compare the current metric data to the set threshold.

subscriptionId

Y

The Azure subscription ID.

resourceGroupName

Y

The name of the resource group for the affected resource.

resourceName

Y

The resource name of the affected resource.

resourceType

Y

The resource type of the affected resource.

resourceId

Y

The resource ID of the affected resource.

resourceRegion

Y

The region or location of the affected resource.

portalLink

Y

A direct link to the portal resource summary page.

properties

N

Optional

A set of key/value pairs that has details about the event. For example, Dictionary<String, String>. The properties field is optional. In a custom UI or logic app-based workflow, users can enter key/value pairs that can be passed via the payload. An alternate way to pass custom properties back to the webhook is via the webhook URI itself (as query parameters).