Monitor Azure events with Logic Apps

In this post I’ll provide a starting point for monitoring Azure with Logic Apps whereby an email is sent when a successful change is made within an Azure subscription.

To start with, check the Event Grid resource provider is registered within your Azure subscription.  You can do this in the Azure portal under Subscriptions -> Resource providers.

EventGrid0

Next, create a Logic App from the Azure portal, entering a name, resource group and location.

EventGrid1

From the splash screen select the common trigger When a Event Grid event occurs.

EventGrid12

Click the sign in button to connect to your Azure subscription.

EventGrid13

Select your Azure subscription, resource type and resource name.  In this example I’ve selected the subscription, for event monitoring across the entire subscription, but you can choose resource group or something else to scope the alerts further.  I’ve also added an event type filter for WriteSuccess, but again you can adjust as per your requirements.

EventGrid14

 

In this example I’ve chosen to be notified by email, so click on new step, then select Office 365 Outlook, followed by send an email.

EventGrid15

Populate the email body with event information that interests you.

EventGrid16

 

Save the Logic App, then make a change, e.g. resize a VM or create a resource within the subscription to trigger the alert.

If you don’t receive an email check the runs history on the Logic App page.

EventGrid17

If nothing is listed check that the Logic app automatically created the Event Grid subscription.  Search for Event Grid subscriptions in the Azure portal.

EventGrid18

If nothing is listed re-register the EventGrid resource provider in your Subscription.  I did this using Azure Cloud Shell Register-Azure RmResource Provider -ProviderNamespace Microsoft.EventGrid.

EventGrid19

Once you have the basics working you can customise further, e.g. to only notify for changes related to virtual machines.  In a future post I’ll show how to do this.

Advertisement

1 thought on “Monitor Azure events with Logic Apps

  1. Pingback: Monitor Azure events with Logic Apps – follow up | Richard Skinner

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s