Connect Stream Analytics to Your IoT Hub: Microsoft Azure IoT Developer Exam

Connect Stream Analytics to Your IoT Hub

Question

Using real-time data ingested from the hundreds of sensors connected to your IoT hub, you need to extract, aggregate, and send some key data to PowerBI dashboards for real-time display.

You decide to use Stream Analytics for cost-effective real-time event processing.

How should you connect Stream Analytics to your IoT hub?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: A.

Option A is CORRECT because you need to create a consumer group in the built-in endpoints and then use that as a source connection in the Inputs section of Stream Analytics.

Option B is incorrect because in message routing you can only use Azure Storage, Event Hubs, and Service Bus as custom endpoints.

Stream Analytics is not an option.

Option C is incorrect because you cannot create custom endpoints.

Instead, a consumer group must be created for the built-in Events endpoint so that other back-end services can pull data from the IoT hub.

Option D is incorrect because while technically, you can use storage containers as inputs for Stream Analytics jobs, in the current scenario real-time behavior is required, hence ingestion directly from the IoT hub is recommended.

Diagram:

Ingest

lot
Devices

Logs, Files

Customer
data, Financial
transactions

Weather data

Business Apps

 —)
Event Hubs

+ an

Azure blob
storage

Xx

loT Hub

Analyze

Continuous Intelligence/Real-time analytics

om)
=

Stream Analytics

i A
Reference Data Real-time scoring
SQL DB, Blob store Azure ML service

Deliver

Alerts and actions

Event Hubs, Service Bus,
Azure Functions etc

Dynamic Dashboarding
Power Bl

Data Warehousing

Azure Synapse
Analytics

Storage/ Archival

SQL DB, Azure Data Lake Gen 1 &
Gen 2, Cosmos DB, Blob storage, etc

References:

To connect Stream Analytics to your IoT hub and process real-time data ingested from sensors, you can follow the below steps:

  1. Create a Stream Analytics job: First, you need to create a Stream Analytics job in Azure. To do this, navigate to the Azure portal and create a new Stream Analytics job. Give it a name and configure the job settings as required.

  2. Configure input source: In the Stream Analytics job configuration, you need to configure the input source to connect to your IoT hub. To do this, select the IoT Hub input type and provide the IoT hub connection string.

  3. Configure output sink: Next, you need to configure the output sink for the Stream Analytics job. This is where the processed data will be sent to be displayed on PowerBI dashboards. In this case, select PowerBI as the output sink and provide the required credentials.

  4. Connect Stream Analytics to IoT hub: To connect Stream Analytics to your IoT hub, you need to create a message route in the IoT hub that sends the data to the Stream Analytics job endpoint. This can be done by configuring a message route from the IoT hub to the Stream Analytics job endpoint.

    Answer B. "In the IoT Hub, add a message route to the Stream Analytics job endpoint" is the correct answer as it describes the process of connecting the Stream Analytics job to the IoT Hub by creating a message route to send data to the job endpoint.

    Option A is incorrect as it mentions creating a consumer group in IoT Hub, which is not required to connect Stream Analytics to IoT Hub.

    Option C is incorrect as it mentions creating a custom endpoint in IoT Hub, which is not a valid option for connecting Stream Analytics to IoT Hub.

    Option D is incorrect as it mentions creating a message route to Azure Storage, which is not required to connect Stream Analytics to IoT Hub for real-time event processing.