Home » Microsoft » AZ-220 v.2 » What should you do?
You have an Azure IoT hub that has 1,000 registered devices.
You create an Azure logic app.
You need to send Device Connected and Device Disconnected events in real time to the logic app.
What should you do?
A. From the Message routing blade of the IoT hub, add a route, Route DeviceLifecycleEvents to an Azure Service Bus queue.
B. From the Diagnostic settings blade of the IoT hub, add a diagnostic setting. Route the connection logs to a Log Analytics workspace.
C. From the Events blade of the IoT hub, add an event subscription. Configure the Filter to Event Types setting and route the events to a webhook.
Correct Answer: C
Explanation/Reference:
Explanation:
Adding an Event subscription. Example:
To proceed with Event Grid events, go back to the Event tab in your IoT Hub.
Add an Event subscription and name it ‘DeviceRelated’. The default selected event types to send are device creation, device deletion, device connected, device disconnected.
And we see the event schemas:
Just keep it to the Event Grid Schema. You can experiment with other schemas on your own.
Because we added the subscription from within our IoT Hub, this IoT Hub is selected as Topic resource.
For the endpoint, select ‘Webhook’ as the type and fill in your assembled endpoint URL.
Reference:
https://sandervandevelde.wordpress.com/2019/12/20/subscribe-your-iothub-to-eventgrid-as-event-source/