If you download and run this reference implementation you will be able to simulate sensors data, check alarms in the dashboard and/or receive notification emails. Also, you will be able to get reports being built using Databricks.
You can find the complete article describing the scenario tackled with this reference implementation here.
In order to test our solution, you will need the following:
- An active Azure subscription.
- The az-cli.
- The databricks-cli.
- NodeJS (necessary to run the sample emulator locally).
To run our solution follow the instructions detailed in the README files within each of the subfolders that explain how to run the emulator locally and deploy the solution to your Azure subscription.
Take into consideration that the deployment will create the following resources in your Azure subscription which you should manually delete after you finish to avoid incurring in extra costs:
- An IoT Hub.
- A Stream Analytics Job.
- A storage account.
- An Event Hub with the Data Capture functionality enabled.
- An Azure Function app with two Azure functions.
- A Logic App.
- A Log Analytics instance.
- An Azure Monitor instance.
- A Databricks instance.
The telemetry messages sent by the sensors emulator to the IoT Hub follow the schema:
{
Data: [{
value: number,
timestamp: string (yyyy-MM-ddTHH:mm:ss.SSSZ),
}],
Properties: {
measType: 'temperature' | 'power',
factoryArea: 'A' | 'B',
machineType: 'PickAndPlaceArmEngine' | 'ConveyorBeltEngine',
}
}
The data includes only the measured value and a timestamp indicating when the sample was taken. The measurement type alongside the factory area and machine type the sensor is attached to are included in the message properties which are used in later stages to calculate historic analytics.
The alarm events generated by the Azure Stream Analytics Job to the Event Hub follow the schema:
{
status: 'on' | 'off',
timestamp: string (yyyy-MM-ddTHH:mm:ss.SSSZ),
type: 'temperature' | 'power',
deviceId: string,
factoryArea: 'A' | 'B',
machineType: 'PickAndPlaceArmEngine' | 'ConveyorBeltEngine',
}