Share via

How can I trigger a Function with specific logs from IoT Hub?

KURAMOTOAHUJATAIRA-3118 250 Reputation points
2023-05-31T00:31:54.8233333+00:00

"How can I trigger a Function with specific logs from IoT Hub? I want to execute a particular Function when the records retrievable by the following query are output. Query:

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS"
| where Category == "JobsOperations"
| where OperationName == "jobFailed" 

I have received information that I need to include "type": "eventHubTrigger" in the function.json, but I'm unsure about the other specific configuration steps. I would greatly appreciate it if you could provide a simplified way to achieve the above."

Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.

Azure IoT Hub
Azure IoT Hub

An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.

Azure Event Grid
Azure Event Grid

An Azure event routing service designed for high availability, consistent performance, and dynamic scale.


Answer accepted by question author

Sedat SALMAN 14,455 Reputation points MVP
2023-06-01T19:58:45.15+00:00

Create a Stream Analytics first then you can send the output to event hub or azure function

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.