This is simple console application to send temperature breach alert inteventHub in every minute.
This function listen to service bus and push data into CosmosDB and same time create csv file in blob (yyyy-mm-dd HH-mm) storage. Azure Stream analytics update reference data in every minute. I'm using this file as reference data for device last alert.
https://github.com/PankajRawat333/TemperatureAlert/tree/master/Code/AlertFunction/AlertFunction
https://github.com/PankajRawat333/TemperatureAlert/blob/master/TemperatureAlert.json
https://github.com/PankajRawat333/TemperatureAlert/blob/master/DeviceThersholdLimit.csv
https://github.com/PankajRawat333/TemperatureAlert/blob/master/temperature-alerts.csv Before starting Stream Analytics job, Create blank csv file in blob, later Azure function will create as per Alert data.
https://github.com/PankajRawat333/TemperatureAlert/blob/master/TemperatureAlertQuery.txt
- This is POC code not for production.
- I have tested only for one device, required some modification for multiple devices.
- Required additional code to remove unused reference data.