Getting Slack Notifications with Azure Monitor

An option when trying to get alerts from Azure Monitor (such as web tests, processing alerts and more) is to get them to a Slack channel to allow for an alternative to receiving alerts via email.

Setting up Slack

To start, you’ll need to have a Slack workspace with an available app. If needed, create the channel desired to receive notifications.

Create a new Slack app named “Azure Notifications” and turn on the “Incoming Webhooks” capability, which will provide a URL (webhook) that you’ll use later to receive the notifications from Azure.

Creating Conversion Logic App in Azure

Next, you’ll need to create a logic app in Azure that takes the alert provided from Azure and converts the message into something that can be displayed in Slack.

Create a logic app, open Code View and use the following (replacing the URI provided with the one above):

You can test by running the code directly, and see if you get a red circle:

Assuming this is in place, the final step is creating an action group that allows for setting alerts to send to the Slack channel.

Before going to the next step, take note of the webhook provided by the Logic App:

Setting up Action Group

The final step is setting up an action group with the Logic App webhook, while turning on the Common Alert Schema.