Industrial IoT & Digital Twin Console
Engineered core modules of an industrial remote-monitoring console unifying Cosmos DB telemetry, Azure Digital Twins 3D scenes, rule-based alerting and embedded Power BI behind Entra ID, including token-cached report embedding and KQL-driven audit trails.
- Role
- Full-stack engineer · frontend & Node APIs
- Year
- 2022–2023
- Type
- IoT & digital twins
- Stack
- React · TypeScript · Azure Digital Twins (3D Scenes) · Azure Cosmos DB · Power BI Embedded · Node.js · Express · Microsoft Entra ID · MSAL · Application Insights · Log Analytics (KQL) · Azure Maps · Redux · Monaco Editor
The problem
Operations teams monitoring pumps, chillers, compressors, energy meters and utility plants had telemetry, alarms, twin state and BI reports spread across IoT Hub, Cosmos DB, Azure Digital Twins and separate reports. The product needed one authenticated console for live and historical monitoring, rule authoring, alarm handling, and device and firmware management.
Architecture
- 01
Telemetry
Device readings, alarms and anomaly-detection results stored in Cosmos DB collections and served through Node.js/Express APIs.
- 02
Normalisation
Energy-meter and AHU readings mapped to a common {name, currentvalue, units, lastUpdated, quality} contract, including area- and shift-wise consumption.
- 03
Twin layer
Azure Digital Twins 3D scenes rendered with iot-cardboard-js, with ADT and Blob calls routed through a host-allowlisting proxy.
- 04
Rules
Monaco-authored JavaScript formulas compile-checked on a hosted execution service before being saved to alert rules.
- 05
Analytics
Power BI reports embedded with user-scoped embed tokens; Application Insights events queried back through Log Analytics KQL for audits.
- 06
Identity
Microsoft Entra ID (MSAL) secures the SPA and scopes delegated tokens for the Power BI and Log Analytics APIs.
Engineering highlights
01
Embedded Power BI authoring
Built Power BI embedding on the user's MSAL token, calling GenerateToken with edit and save-as rights, caching embed tokens until expiry, and adding edit/view switching, save, visual deletion and per-visual Excel export.
02
Compile-checked formula rules
Delivered a Monaco-based custom-formula editor: JavaScript is base64-encoded, submitted to a hosted code-execution API and polled every 2 seconds until a terminal status, so only compiling formulas are persisted to rules.
03
Action telemetry and audits
Instrumented alert dismissal, device and KPI creation and firmware deployment as Application Insights custom events, then surfaced them on an audit page through MSAL-authorised Log Analytics KQL queries.
04
Hardened digital twin access
Validated service-principal authentication from Express to Azure Digital Twins. Twin and Blob traffic passes a proxy that allowlists headers, verifies target hosts against official Azure domain suffixes and retries Blob calls on ECONNRESET.
05
Telemetry normalisation APIs
Extended the Node APIs for energy-meter and AHU telemetry, with area- and shift-wise (A/B/C) consumption normalised to a common property contract, plus Blob Storage file routes and an alert-deletion endpoint.