Skip to content

IoT analytics on Azure

Devices send MQTT telemetry to IoT Hub, which feeds Azure Stream Analytics into Azure Cosmos DB for the operational app and, in parallel, Azure Data Explorer through its data connection, which exports Parquet to Data Lake Storage and answers Azure Managed Grafana dashboards and Logic Apps alerts.

azure9 nodes2 groups8 edges
Edit in the playgroundOpen full size
IoT analytics on Azure: IoT Hub, Azure Stream Analytics and Azure Cosmos DB for an operational app, and Azure Data Explorer with Data Lake Storage, Azure Managed Grafana and Logic AppsIoT analytics on Azure: IoT Hub, Azure Stream Analytics and Azure Cosmos DB for an operational app, and Azure Data Explorer with Data Lake Storage, Azure Managed Grafana and Logic AppsIoT analytics on Azure: IoT Hub, Azure Stream Analytics and Azure Cosmos DB for an operational app, and Azure Data Explorer with Data Lake Storage, Azure Managed Grafana and Logic AppsIoT analytics on Azure: IoT Hub, Azure Stream Analytics and Azure Cosmos DB for an operational app, and Azure Data Explorer with Data Lake Storage, Azure Managed Grafana and Logic Apps
azure-iot-analytics.yamlOn GitHub
# yaml-language-server: $schema=../references/diagram.schema.json
title: IoT analytics on Azure
subtitle: IoT Hub feeds Stream Analytics and Cosmos DB for the operational app, and Azure Data Explorer for dashboards, alerts and export to the data lake
direction: right
# Filled triangles, as in Azure's reference diagrams; one port per edge.
arrowhead: filled
# Compact spacing keeps the four columns inside a README column at full label size.
layout: { merge: false, spacing: compact }

legend:
  solid: Telemetry and queries

groups:
  sub: { type: azure:subscription, label: IoT subscription }
  rg: { type: azure:resource-group, label: rg-iot-analytics, in: sub }

nodes:
  devices: { icon: generic:iot, label: IoT devices, note: "Vehicles, machines, sensors" }
  iothub: { icon: azure:iot-hub, label: IoT Hub, note: Telemetry and commands, in: rg }
  # The operational path: a near real-time job keeps device state in Cosmos DB for the app.
  asa: { icon: azure:stream-analytics-jobs, label: Azure Stream Analytics, note: Near real-time job, in: rg }
  cosmos: { icon: azure:azure-cosmos-db, label: Azure Cosmos DB, note: JSON device state, in: rg }
  opsapp: { icon: generic:mobile, label: Operational app, note: "Mobile, web and kiosk" }
  # The analytical path: Data Explorer ingests the same telemetry through its IoT Hub connector.
  adx: { icon: azure:azure-data-explorer-clusters, label: Azure Data Explorer, note: Time-series cluster, in: rg }
  lake: { icon: azure:storage-accounts, label: Data Lake Storage, note: Partitioned Parquet, in: rg }
  grafana: { icon: azure:azure-managed-grafana, label: Azure Managed Grafana, note: Dashboards, in: rg }
  alerts: { icon: azure:logic-apps, label: Logic Apps, note: Alerts and notifications, in: rg }

# Left out: the Cosmos DB change feed route through Functions to Event Hubs, the alternative to
# routing telemetry to Cosmos DB and Data Explorer in parallel.
edges:
  - devices -> iothub: MQTT
  - iothub -> asa
  - asa -> cosmos
  # The app reads Cosmos DB, so its arrow starts at the app.
  - opsapp -> cosmos: reads
  - iothub -> adx: data connection
  - adx -> lake: export
  # Grafana and the Logic Apps connector both query Data Explorer; the arrowheads stay on it.
  - { from: adx, to: grafana, arrow: start, label: KQL }
  - { from: adx, to: alerts, arrow: start }

Start from this one

Copies the spec to diagram.yaml, then renders every format.

$ orrery init azure-iot-analytics$ orrery render diagram.yaml -f all --theme both