Azure IoT Hub vs Event Hub: Architecture Comparison (2026)

Azure IoT Hub vs Event Hub: Architecture Comparison (2026)

IoT Hub vs Event Hub: Azure Architecture Compared for 2026

Teams keep asking the wrong version of the IoT Hub vs Event Hub question. They ask which one is faster or cheaper per message, when the real difference is what each service knows about the thing on the other end of the connection. IoT Hub knows a device by name, holds its credential, keeps a JSON twin of its state, and can send it a command. Event Hubs knows only that bytes arrived on a partition.

That distinction matters more in late 2026 than it did a year ago. Microsoft closed new Azure IoT Central application creation in September 2026 and pointed customers toward IoT Hub, Device Provisioning Service and Fabric Real-Time Intelligence, while Event Hubs and Event Grid both widened their MQTT and Kafka stories. The old two-box diagram no longer covers the options.

You will leave with a mechanism-level model of both services, worked capacity numbers you can reuse, a corrected view of several limits that older articles get wrong, and a decision flow that includes the Event Grid MQTT broker and Fabric.

What this covers: the current state of the Azure ingestion stack, the architectural split between a device gateway and a streaming log, IoT Hub throttling and Event Hubs partitioning in numbers, the combined reference architecture, failure modes, and a rollout checklist.

Context and Background

Azure has five services that can legitimately sit at the front of a telemetry pipeline: IoT Hub, Event Hubs, Event Grid with its MQTT broker, Service Bus, and the Azure IoT Operations broker that runs on Arc-enabled Kubernetes at the edge. Most “IoT Hub vs Event Hub” articles compare two of the five and ignore the rest, which is how teams end up with a Kafka cluster in front of devices that cannot speak Kafka.

Event Hubs was built as a high-throughput append-only log, deliberately modelled on Kafka’s partition and offset design. It targets clickstreams, logs and application telemetry. IoT Hub was built for a different constraint: millions of constrained, heterogeneous, physically exposed endpoints that need individual identity, revocation and a return channel. Microsoft’s own comparison of IoT Hub and Event Hubs states the recommendation plainly. Use IoT Hub to connect IoT devices to Azure, and even for device-to-cloud-only scenarios it recommends starting there so the richer feature set is available later.

The two services share plumbing. IoT Hub exposes your device-to-cloud telemetry through a built-in endpoint named messages/events that is compatible with the Event Hubs client libraries, so you can read it with an Event Hubs SDK. That compatibility is a convenience, not an equivalence; it is a read surface over a managed internal stream, and it comes with its own limits that differ from a real Event Hubs namespace.

Three 2026 developments change the landscape:

  • IoT Central is on a defined path out. Per Microsoft’s September 2026 guidance and secondary reporting on it, new IoT Central applications can no longer be created and existing ones run until 20 September 2029. Microsoft’s migration playbook names IoT Hub, Device Provisioning Service (DPS) and Fabric Real-Time Intelligence as the target stack. IoT Hub itself is not retiring; it is the recommended destination.
  • Event Grid has a real MQTT broker. It supports MQTT 3.1.1 and 5, including over WebSocket, with topic spaces and client groups. IoT Hub’s documentation now steers people who want a general broker toward it.
  • Fabric Real-Time Intelligence matured into a stack. Eventstreams, Eventhouse (a KQL database), Real-Time dashboards and Activator form a landing zone that reads from both IoT Hub and Event Hubs.

For the queue-versus-stream distinction that sits next to this decision, our Azure Service Bus vs Event Hubs specifications guide covers where Event Hubs stops and brokered messaging starts. For how the Azure choice compares with other clouds, see MindSphere vs AWS IoT SiteWise vs Azure IoT Hub.

A note on method. I verified limits against Microsoft Learn pages while writing this on 31 October 2026. Where a number comes from a secondary source or I could not confirm it, it is marked inline. Prices are deliberately omitted because they vary by region and change; use the Azure pricing calculator for those.

The Architectural Split: Device Gateway vs Streaming Log

IoT Hub is a device gateway: it authenticates each device individually, holds per-device state (identity, twin, pending commands) and offers a return path to the device. Event Hubs is a partitioned, replayable log with no notion of a device, only a producer holding a namespace-level credential.

IoT hub vs event hub architecture: a device gateway with identity registry and twins next to a partitioned streaming log

Figure 1: IoT Hub sits between devices and the cloud with a bidirectional path and an Event Hubs-compatible read surface. Event Hubs is a one-way log with consumer groups and Capture.

The figure shows two different shapes. On the left, traffic is bidirectional and every arrow starts at an identified device. On the right, producers are interchangeable and traffic is strictly inbound; the only structure is the log and who reads it. IoT Hub’s built-in endpoint is the point where the two shapes meet.

What IoT Hub holds that Event Hubs cannot

Identity registry. Each device or module has its own record with its own key or X.509 thumbprint. The registry is the reason a single compromised device can be disabled by one API call without touching the other devices. The hub supports up to 1,000,000 devices and modules combined per hub, and up to 50 hubs per subscription, with at most one Free-tier hub.

Device twin. A twin is a JSON document with tags, desired properties and reported properties. The documented caps are 32 KB each for the desired and reported sections, 8 KB for tags, and 4 KB per individual property. The twin turns fleet configuration into a declarative problem: the back end writes desired state, the device converges and reports, and a query such as “all devices whose reported firmware is below 3.2” returns without any device being contacted.

Direct methods. Synchronous request-response invoked from the cloud. The request and response payloads are each limited to 128 KB. If the device is offline the call fails fast; it is not queued.

Cloud-to-device messages. Asynchronous, queued per device, with up to 50 pending messages per device. The queue is what lets a command survive a device being offline overnight.

Jobs and automatic configurations. Scheduled bulk twin updates and method calls across a query-defined set of devices. The limits page lists 100 automatic device configurations on Basic and Standard, and up to 10 concurrent jobs on S3 (1 on S1, 5 on S2).

None of this exists in Event Hubs. That is not a gap in Event Hubs; a log has no reason to know who wrote to it.

What Event Hubs holds that IoT Hub cannot

A real partitioned log you control. Event Hubs gives you partition count, retention (up to 7 days on Standard, 90 days on Premium and Dedicated), consumer groups (20 on Standard, 100 on Premium, 1,000 on Dedicated), and the Kafka endpoint. IoT Hub’s built-in endpoint gives you a fixed partition set chosen at hub creation, retention of 1 to 7 days and up to 20 consumer groups.

Capture and Schema Registry. Capture writes the stream to Blob Storage or ADLS Gen2 in Avro with no pipeline code. Schema Registry gives Avro and JSON Schema governance. Both are Event Hubs namespace features.

Message size. Per the quotas page, maximum publication size is 256 KB on Basic, 1 MB on Standard and Premium, and 20 MB on Dedicated. IoT Hub caps device-to-cloud messages at 256 KB and cloud-to-device at 64 KB.

Protocol surface

IoT Hub accepts MQTT 3.1.1, AMQP 1.0 and HTTPS, each also over WebSockets where relevant. Event Hubs accepts AMQP 1.0, HTTPS and the Kafka protocol on port 9093, but not MQTT. Two corrections to widely repeated claims. First, IoT Hub’s current MQTT documentation lists MQTT 3.1.1 only; it does not document MQTT 5 support, and recommends Event Grid when you need MQTT 5. Second, the Event Hubs Kafka endpoint is available on Standard, Premium and Dedicated tiers, not only Premium and Dedicated as some summaries state. Kafka Streams and Kafka transactions are in public preview on Premium and Dedicated, with gzip compression generally available on those tiers.

IoT Hub is also not a full MQTT broker, and Microsoft says so. QoS 2 is rejected (the hub closes the connection if a device publishes at QoS 2), retained messages are not persisted, topics are fixed rather than user-defined, and a device may hold only five subscriptions at a time. Only one connection per device ID is allowed; a second connection with the same ID drops the first, which is a classic source of connect-disconnect flapping when a device is cloned or restarted without releasing its session.

Throughput, Throttling, and Capacity in Numbers

Capacity planning is where the two services diverge most, because they meter different things. IoT Hub meters messages per day per unit and applies separate rate throttles to operations. Event Hubs meters bytes and events per second per throughput or processing unit.

IoT Hub: quota, meter size, and throttles

The daily quota depends on the edition, which is a tier (Basic or Standard) plus a size (1, 2 or 3). Capacity depends only on size, so B1 and S1 are identical on throughput. Microsoft documents these per-unit daily limits:

Size Messages per day per unit Data per day per unit Max units
1 (B1/S1) 400,000 1.5 GB 200
2 (B2/S2) 6,000,000 22.8 GB 200
3 (B3/S3) 300,000,000 1,144.4 GB 10

One size-2 unit equals 15 size-1 units in quota terms. A hub has exactly one edition; you cannot mix S1 and B3 units.

The message meter matters because a message is billed against the quota in 4 KB chunks on every tier except Free, which uses 0.5 KB. A 9 KB telemetry payload therefore consumes three messages of quota, not one. Teams that batch aggressively to save quota can still burn it with large payloads; the fix is to compress or trim payloads, not merely to send fewer of them.

The throttles are the part people miss. They are enforced per second or per minute, separately from the daily quota, and violating them returns HTTP 429 ThrottlingException. From the quotas page:

Operation S1 / B1 S2 / B2 S3 / B3
New device connections higher of 100/s or 12/s per unit 120/s per unit 6,000/s per unit
Device-to-cloud sends higher of 100/s or 12/s per unit 120/s per unit 6,000/s per unit
Cloud-to-device sends 1.67/s per unit (100/min) 1.67/s per unit 83.33/s per unit
Twin reads 100/s higher of 100/s or 10/s per unit 500/s per unit
Twin updates 50/s higher of 50/s or 5/s per unit 250/s per unit
Registry operations 100/min per unit 100/min per unit 5,000/min per unit
Queries 20/min per unit 20/min per unit 1,000/min per unit

Basic tier has no cloud-to-device, twin, jobs or direct-method operations at all, so those rows apply to Standard.

Worked example 1: sizing a 10,000-device fleet. Each device sends a 2 KB reading every 10 seconds. Dividing 10,000 devices by a 10-second interval gives 1,000 messages per second fleet-wide. Over a day that is 86,400,000 messages, and since 2 KB fits inside one 4 KB meter chunk, the quota cost is 86.4 million messages. One S2 unit offers 6,000,000 per day, so you need 15 S2 units (90 million), or equivalently 216 size-1 units, which exceeds the 200-unit cap. S2 with 15 units is therefore the sensible choice. Check the send throttle too: 15 S2 units allow 15 × 120 = 1,800 sends per second, comfortably above the 1,000/s average, with 80 percent headroom for bursts.

Worked example 2: the reconnect storm. Suppose that same hub loses a regional link and all 10,000 devices reconnect within the same few seconds. New-connection throttle on 15 S2 units is 15 × 120 = 1,800 per second, so a full reconnect takes about 5.6 seconds if devices are perfectly metered. Now take a smaller hub: three S1 units. The connection throttle is the higher of 100/s or 36/s, so 100/s. Reconnecting 50,000 devices at 100/s takes 500 seconds, over eight minutes, during which most clients are hitting 429s and retrying. If every client retries on a fixed one-second timer, retries add load, and the storm self-sustains. The daily message quota is irrelevant here; the connection rate is what bites.

Event Hubs: units, partitions, and ordering

Event Hubs meters ingress in throughput units (TUs) on Basic and Standard, processing units (PUs) on Premium, and capacity units (CUs) on Dedicated. One TU provides 1 MB per second or 1,000 events per second of ingress, whichever is hit first, and 2 MB per second or 4,096 events per second of egress. Standard and Basic top out at 40 TUs; Premium at 16 PUs per namespace; Dedicated at 10 CUs before a support request.

Partitions are the unit of parallelism and of ordering. Order is guaranteed only within a partition, and a consumer group can run at most one active reader per partition. A hub on Basic or Standard can have up to 32 partitions; Premium allows 100 per event hub and Dedicated up to 1,024. Partition count on Basic and Standard cannot change after creation, while Premium and Dedicated support dynamic partition scale-out. IoT Hub’s built-in endpoint has the same property: partitions are set at hub creation, cannot be changed, and top out at 32 on Basic and Standard, though Microsoft notes most hubs need only four.

Event Hubs partitioning for iot hub vs event hub design: producers hash to partitions, consumer groups hold independent offsets

Figure 2: A partition key sends all events with the same key to one ordered partition. Each consumer group keeps its own offset per partition, so readers never interfere.

The diagram shows why per-device ordering is cheap in Event Hubs and why hot partitions happen. If you key by device ID, all of one device’s readings land in one partition in order. If one device (a gateway aggregating a whole plant) emits 100 times more than its peers, its partition runs hot while the others idle, and adding throughput units does not fix it because TUs are a namespace-level allowance while the ordering unit is the partition.

Worked example 3: partitions for a consumer pipeline. Suppose ingress is 8 MB per second with 2 KB events, which is 4,000 events per second. On Standard that needs at least 8 TUs by bytes and 4 TUs by events, so 8 TUs. A Stream Analytics job or Spark consumer that can process about 1 MB per second per reader needs at least 8 parallel readers, so at least 8 partitions. Provisioning 16 gives headroom to double consumer parallelism without a migration. Over-provisioning is cheap on Standard because you pay for TUs rather than partitions, but note every partition adds client connections and checkpoint overhead, so 32 is not a free default.

The built-in endpoint is not an Event Hubs namespace

The built-in endpoint reads like an Event Hubs hub because it speaks AMQP on port 5671 (or WebSockets on 443) and accepts a connection string with an EntityPath. But it is a managed internal stream with these documented constraints:

  • Up to 20 consumer groups per hub, which is the same as the Standard Event Hubs allowance and much lower than Premium or Dedicated. Older articles quote five; the current documentation says 20.
  • Retention of 1 day by default, adjustable to a maximum of 7 days. Retention is a minimum guarantee tied to tier and unit type: one S1 unit retains at least 400,000 messages of 4 KB each, so smaller messages may be kept longer.
  • No Kafka endpoint, no native Capture, no Schema Registry. If you need any of these, you route.
  • Once you create any custom route, data stops flowing to the built-in endpoint unless a route points to it or the fallback route is enabled. The fallback route is on by default when you create a hub in the portal or CLI, but if you create routes and delete them, a still-enabled fallback keeps delivering. That behaviour surprises people in both directions.

Message routing is the escape hatch. Routes can target the built-in endpoint, Blob Storage containers, Service Bus queues and topics, Event Hubs, Cosmos DB and Fabric Eventstreams (the Eventstreams endpoint is listed as preview on the routing page). A message goes to every endpoint whose query it matches; the first route adds typically under 500 ms of latency on average, and the limit is 100 routing queries on Basic and Standard hubs, 5 on Free, with 10 custom endpoints.

The Kafka endpoint, precisely

The Event Hubs Kafka surface lets existing Kafka producers and consumers connect by changing the bootstrap server to NAMESPACE.servicebus.windows.net:9093 with SASL_SSL. Authentication is either OAuth 2.0 (OAUTHBEARER, integrated with Microsoft Entra ID) or SAS via PLAIN using $ConnectionString as the username. Microsoft supports Kafka protocol 1.0 and later. Concepts map directly: namespace is cluster, event hub is topic, and partitions, consumer groups and offsets are the same.

Know what you are not getting. Delivery is at-least-once, so consumers must be idempotent. Dead-letter queues, competing consumers and server-side rule-based subscriptions are not Event Hubs features; Microsoft points to Service Bus or Event Grid for those. If you depend on unsupported Kafka features, a self-managed or other managed Kafka cluster is the honest answer. Our walkthrough of Kafka exactly-once semantics explains why the transactions gap matters.

Security, Provisioning, and the Event Grid MQTT Option

Credentials: where the blast radius lives

With Event Hubs, a producer authenticates with a namespace or hub-level shared access policy, or with Microsoft Entra ID through managed identity or a service principal. The namespace allows 12 authorization rules in total. If you put a fleet of field devices on a single shared access key, a leak from any one device compromises all of them, and revoking the key breaks all of them. Entra ID managed identities are far better for cloud-hosted producers, but a camera bolted to a pole has no managed identity.

IoT Hub’s registry provides a credential per device: a symmetric key used to mint SAS tokens, or an X.509 certificate with thumbprint or CA-signed chain (up to 25 CA certificates are supported per hub). A device presents its own identity at connection time and the hub can disable it individually. MQTT over TLS runs on port 8883 and over WebSockets on 443; port 1883 is not supported, and TLS 1.2 is required. In production, prefer X.509 anchored in a secure element or TPM rather than shared symmetric keys, as Microsoft itself notes SAS is convenient for testing while certificates are the more secure option.

DPS: zero-touch is a pipeline, not a feature

Device Provisioning Service assigns a device to an IoT Hub on first boot. A device ships with an ID scope and an attestation method (X.509 chain, TPM or symmetric key within an enrollment group), contacts DPS, and receives the hub assignment plus credentials. The DPS layer is also the lever for re-provisioning when you move devices between hubs, which is how IoT Central migrations work: devices either implement a DeviceMove command handled by the IoTC Migrator tool, receive a firmware update pointing at a new DPS ID scope, or go through a case-by-case Microsoft Support review when the ID scope is baked into immutable firmware.

Event Grid MQTT broker: the third option

IoT Hub’s own documentation lists what it lacks as an MQTT broker: no QoS 2, no retained message persistence, fixed topics, five subscriptions per device, and a 256 KB message cap. The Event Grid MQTT broker covers the gaps. It supports MQTT 3.1.1 and 5 (including over WebSocket), custom hierarchical topics with wildcards, a 1 MB publish limit (the IoT Hub MQTT page cites 512 KB for Event Grid, so confirm which limit applies to your protocol version), client authentication with X.509, Entra ID, OAuth 2.0 JWT or custom webhook, and role-style access control through client groups and topic spaces. QoS 2 is also not supported there.

Two cautions. First, Event Grid MQTT has no device twin, direct method or job system; it is a broker, not a fleet manager. If you pick it you need your own desired-state mechanism, which many teams build with retained-style topics and a registry service. Second, I could not confirm general availability status for every feature from the overview page alone, so check the current status before standardising on it. The broker routes MQTT messages onward to Event Grid topics, webhooks and, via namespace topics, to Event Hubs.

The practical reading: for a greenfield program that needs device identity, twins and commands, IoT Hub remains the managed answer. For a program that needs a conventional pub/sub MQTT topology and MQTT 5 features, evaluate Event Grid, and consider whether you want IoT Hub only for provisioning and management. For store-and-forward behaviour at the plant edge, see our guide to MQTT store-and-forward and broker bridging.

The Combined Reference Architecture

The pattern most mature Azure IoT programs converge on keeps IoT Hub as the control plane and uses Event Hubs and Fabric as the data plane.

iot hub vs event hub combined pattern: devices to DPS and IoT Hub, routed to Event Hubs and Fabric Eventstream with Capture

Figure 3: The combined pattern. IoT Hub owns provisioning and the device-facing control plane; Event Hubs and Fabric own fan-out, archival and analytics.

Devices register through DPS, connect to IoT Hub, and send telemetry there. IoT Hub routing sends selected categories, for example alerts, to an Event Hubs namespace that you own, and the built-in endpoint carries the full stream. Both feed a Fabric Eventstream. From there the data lands in an Eventhouse (a KQL database), is visualised through Real-Time dashboards, and triggers rules through Activator. Event Hubs Capture archives raw Avro to ADLS Gen2 for batch work. The back-end application never touches the data plane; it uses IoT Hub for twins and direct methods.

Why split the planes

The planes fail differently. Device management is low-volume, latency-sensitive and consistency-sensitive: you care that a command reached exactly the intended device. Telemetry is high-volume and tolerant of delay and occasional duplication. Putting them on one service means one set of quotas protects both, so a burst of telemetry cannot starve command traffic, because commands and twins are throttled separately from device-to-cloud sends. Splitting at the route also lets you size the Event Hubs side independently, with 100 partitions and 90-day retention on Premium when your analysts want a quarter of history, something the built-in endpoint cannot offer.

What Fabric adds and what to verify

Fabric Real-Time Intelligence is a service for data in motion. Its Real-Time hub lists Azure IoT Hub and Azure Event Hubs among Microsoft sources, and Eventstreams provide no-code filtering, transformation, windowed aggregation and duplicate detection before landing in Eventhouse. Activator monitors conditions and triggers notifications, pipelines or Power Automate flows. Microsoft’s IoT Central migration guidance points at a Fabric accelerator repository as the starting template.

I could not confirm from the overview page whether each connector and the IoT Hub routing endpoint to Eventstreams has reached general availability; the routing page labels Eventstreams as a preview endpoint. If you need a contractual SLA on that hop, validate the current status or land data in Event Hubs first and attach Eventstream there. For the downstream storage choices, see Azure time series databases: Data Explorer and Cosmos DB.

Cost Model and the IoT Central Transition

I am not quoting prices; they differ by region and change, and any figure I gave would be stale by the time you read it. What I can give you is the shape of each bill, because the shape drives architecture.

IoT Hub bills by edition and unit count. You pay for provisioned units regardless of whether you use the quota, and you add units when the daily message allowance or a throttle is exhausted. Cost is therefore a step function: at 86.4 million messages per day in the example above, you buy 15 S2 units whether devices send at 100 percent or 70 percent of that rate. Autoscaling units within the same tier is possible, but units added are not returned automatically, so build the scale-down path.

Event Hubs bills by capacity plus, on lower tiers, ingress. Standard charges per throughput unit-hour and per million ingress events; Premium and Dedicated include ingress events in the capacity charge, and Capture is included on those tiers while Standard charges for it hourly. The shape is smoother and tracks bytes. That is why, for the same raw volume, a pure streaming workload is usually cheaper on Event Hubs, a conclusion that holds only when the producers are not devices needing identity.

Where the comparison misleads. A per-message price comparison ignores the engineering you replace. Building per-device credentials with revocation, a command queue with acknowledgement, twin-style desired-state sync, and a provisioning flow on top of Event Hubs is months of work with a security review at the end. If your producers are devices that leave your controlled network, that cost almost always dominates.

Where IoT Hub is the wrong cost shape. A handful of trusted gateways inside your own VNet, each forwarding thousands of messages per second under shared credentials, consume daily quota quickly while using none of the per-device features you are paying for. Put differently, IoT Hub is priced for many modest identities, and Event Hubs for few heavy producers.

What the IoT Central change means for this decision

IoT Central was a SaaS application platform layered over IoT Hub and DPS. Per Microsoft’s guidance published on 25 September 2026, creation of new applications stopped on 23 September and existing applications continue until 20 September 2029 (both dates taken from a secondary summary of the announcement; the primary Microsoft Learn playbook I fetched does not state dates, so verify them in your tenant’s notices). The recommended stack is IoT Hub for connectivity, DPS for provisioning, and Fabric Real-Time Intelligence for analytics, with Device Update for IoT Hub where updates are in scope.

Two consequences matter for the choice you are making today. First, anyone who relied on IoT Central’s dashboards, rules and device templates now has to assemble those from DTDL models, direct methods or desired properties, Fabric dashboards and Activator. Treat the template-to-DTDL mapping as real modelling work; our DTDL v3 and Azure Digital Twins tutorial shows the language those models use. Second, do not read the IoT Central news as a signal against IoT Hub. The migration page lists IoT Hub as the target for secure bidirectional communication, identity, routing, twins, direct methods and jobs.

Trade-offs, Gotchas, and What Goes Wrong

Reconnect storms hit the connection throttle, not the quota. As the worked example showed, three S1 units sustain only 100 new connections per second. Clients must use exponential backoff with jitter, and the hub should be provisioned to a reconnect budget (fleet size divided by acceptable recovery time), not just a message budget. Watch the throttling and connected-devices metrics in Azure Monitor.

Tiers are less symmetric than people assume. Moving from Basic to Standard is allowed without interrupting operations, and partition configuration is unchanged. Moving back from Standard to Basic is not allowed, and Free cannot be converted to either. Earlier versions of this article said Basic to Standard required recreating the hub; that was wrong. The lock-in runs the other direction.

Partition counts are decided on day one. Both the IoT Hub built-in endpoint and Standard Event Hubs fix partition count at creation. Pick for the consumer parallelism you will want in two years. If you need to change it, you migrate: stand up a new hub, repoint producers or routes, and drain the old one.

The 20-consumer-group ceiling arrives quickly. Stream Analytics, Functions, a lake loader, monitoring, a dashboard feed and a partner integration are six readers before you have done anything unusual. Because each consumer group holds a separate offset set and each reader on a partition is a connection, route to a dedicated Event Hubs namespace as soon as you plan more than a handful of consumers.

Retention is a minimum, not a promise of exact duration. With 7 days maximum on the built-in endpoint and Standard Event Hubs, a pipeline outage longer than a week loses data. Premium and Dedicated reach 90 days. If replay across a long outage matters, capture to ADLS rather than relying on retention.

Silent routing failures. Creating a route changes where data flows. If your route query has a typo, messages match nothing and, if the fallback route is disabled, are dropped. Test with Test Route, keep the fallback enabled while iterating, and alert on the dropped-message metrics.

Ordering is per partition and per hub. Neither service gives you global ordering. In IoT Hub the device-to-cloud partition is chosen by the hub, not your key, so cross-device ordering must be reconstructed from timestamps, and clock drift on constrained devices will bite. Our piece on hybrid logical clocks and event ordering covers the fix.

One connection per device ID. A duplicated device identity (a flashed clone, or a firmware bug that reuses an ID) produces a ping-pong where each connection evicts the other. The symptom in logs is ConnectionForcefullyClosedOnNewConnection, not an authentication error.

At-least-once everywhere. Neither IoT Hub routing nor the Kafka endpoint on Event Hubs gives end-to-end exactly-once. Design sinks idempotent, keyed on a device-generated message ID.

Decision Flow and Practical Recommendations

iot hub vs event hub decision flowchart including Event Grid MQTT, Service Bus and routing to Event Hubs

Figure 4: Decision flow. Start with who the producers are, then whether you need a general MQTT broker, then whether you need fleet management, and finally how many independent readers you will have.

The flow compresses into five rules:

  1. Physical devices outside your control point to IoT Hub or Event Grid MQTT, never directly to Event Hubs. Per-device revocation is the deciding factor.
  2. Need twins, commands, jobs or IoT Edge deployments? Standard IoT Hub. Basic omits cloud-to-device messaging, twins, jobs, direct methods and Edge. Start on Standard unless the budget is a hard constraint, since downgrading is not possible.
  3. Need MQTT 5, wildcards, custom topics or broad pub/sub? Evaluate Event Grid’s broker, and decide whether you still need IoT Hub for provisioning and twins.
  4. Producers are your own services? Event Hubs. Use Kafka protocol if you have existing clients, Capture for the cold path, and Schema Registry for governance.
  5. More than a handful of readers, Kafka consumers, or a retention need beyond 7 days? Route from IoT Hub to Event Hubs (Standard for 7 days and 20 groups, Premium for 90 days and 100 groups).

Checklist before you commit

  • [ ] Model daily messages with the 4 KB meter, not the raw count, and size units with 30 to 50 percent headroom.
  • [ ] Compute a reconnect budget: fleet size divided by acceptable recovery seconds must be below the connection throttle.
  • [ ] Choose IoT Hub and Event Hubs partition counts for two years of consumer parallelism.
  • [ ] Decide X.509 versus SAS per device class, and where private keys live.
  • [ ] Verify the fallback route and a test route exist before go-live.
  • [ ] Put an Event Hubs namespace behind IoT Hub routing if you expect more than a handful of readers.
  • [ ] Confirm Fabric and Event Grid MQTT feature status against current Microsoft Learn pages.
  • [ ] If migrating from IoT Central, inventory templates, commands, exports and rules before touching devices.

Frequently Asked Questions

Is Azure IoT Hub built on top of Event Hubs?

Partly. IoT Hub’s device-to-cloud telemetry flows through an Event Hubs-compatible stream, which is why you can read the messages/events built-in endpoint with an Event Hubs SDK. The identity registry, twins, direct methods, cloud-to-device queues and DPS integration are separate IoT Hub components that Event Hubs does not have. The built-in endpoint is not a full namespace: no Kafka endpoint, no Capture, and a fixed set of up to 20 consumer groups.

Can I connect devices directly to Event Hubs?

Technically yes, over AMQP 1.0, HTTPS or Kafka, but you lose per-device identity, revocation, cloud-to-device messaging, twins and MQTT. Producers share a namespace or hub-level credential, so one leak forces a rotation for everyone. This is acceptable only when the devices are well-governed services inside your own infrastructure, or when each producer authenticates with its own Microsoft Entra identity. For field devices, use IoT Hub or the Event Grid MQTT broker.

Does Event Hubs support MQTT, and does IoT Hub support MQTT 5?

Event Hubs does not accept MQTT connections. IoT Hub supports MQTT 3.1.1 only according to its current documentation, with limits: no QoS 2, no retained message persistence, fixed topics and five subscriptions per device. It is not a full broker, and the docs recommend the Azure Event Grid MQTT broker when you need MQTT 5 and flexible topics. Event Grid supports MQTT 3.1.1 and 5, but also does not support QoS 2.

Is the Kafka endpoint only on Premium Event Hubs?

No. The Kafka endpoint at port 9093 is available on Standard, Premium and Dedicated tiers; Basic does not include it. What is tier-restricted is the extras: Kafka Streams and Kafka transactions are in public preview on Premium and Dedicated, and gzip compression is generally available there. Event Hubs delivery is at-least-once, and features such as dead-letter queues and competing consumers are not provided.

Is Azure IoT Hub being retired along with IoT Central?

No. Microsoft’s IoT Central migration playbook names IoT Hub, Device Provisioning Service and Fabric Real-Time Intelligence as the target architecture. Reporting on the announcement says new IoT Central applications can no longer be created and existing ones run until September 2029. I found no retirement notice for IoT Hub itself, but check the Azure updates page before a long-horizon commitment, since I verified this on 31 October 2026 only.

When should I use both services together?

Use both when you have real devices needing identity and commands, plus downstream demands that exceed the built-in endpoint: more than 20 consumer groups, Kafka-protocol consumers, retention beyond 7 days, Capture, or Schema Registry. IoT Hub handles the device edge and provisioning, and a message routing rule copies the stream to an Event Hubs namespace you own. This keeps the control plane and data plane separately sized and separately throttled.

Further Reading

By Riju — about

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *