Lab – monitoring device connection and disconnection with Event Grid
In this lab, we will create an automated email when a device connects or disconnects from an IoT hub:
- In a new resource group, create an IoT hub.
- On the menu for the IoT hub, select the Events option.
On the Events page, you can see some examples of event consumers:
Figure 12.6 – Natively supported event handlers
- Select the Logic Apps option. This will open the Logic Apps Designer page with a connection to the Event Grid service:
Figure 12.7 – Creating a logic app to respond to the event
- Sign in to the Event Grid service. Select the Continue button after signing in.
- Select Microsoft.Devices.IoTHubs as the resource type and select Microsoft.Devices.DevicesConnected as the event type. Enter a value (of your choice) for the Subscription name:
Figure 12.8 – Filling out the necessary...