Written by Ronnie Quan


You will create a simulated device that sends vibration telemetry to your IoT hub. With your simulated data arriving at IoT hub, you will implement an IoT Hub Message Route and Azure Stream Analytics job that can be used to archive data.



Upload CLI Script

When execute the CLI script, if see following error, either ignore the warning or install extension upfront.

Create IoT Hub iot-rquan - WARNING:
Comprehensive IoT functionality is available in the Azure IoT CLI Extension.
To install the extension, run: "az extension add --name azure-iot"For more info and install guide go to: https://github.com/Azure
IOT Resources Are Created

The app simulates an IoT device that is monitoring the conveyor belt and report vibration sensor data every two seconds.

Vibration monitoring scenario requires you to create two message routes:

If you choose Managed Identity, you need to add your Stream Analytics job to the storage account’s access control list with the Storage Blob Data Contributor role.

We first create stream analytics job, and get the managed identity, then grant either data plane role or storage account control plane role to it, come back and enable using our own storage account.

Enable Managed Identity Authentication

Define input, output and query for stream analytics job, then start the job.

Define input, output and query

Three containers are present in the storage account, first two are created by stream analytics PaaS service for job definition and job run data. Our output data is in vibrationcontainer.

Now we see the vibration sensor data is sent from IOT device to IOT Hub, then to Stream Analytics, then to storage account.

Security Features

Configure storage account to selected network, do not open to all network.





All blogs are strictly personal and do not reflect the views of my employer https://www.linkedin.com/in/ronnie-q-8025987