Both Event Hub and IOT Hub are used for stream ingestion.
So when do we use which?
Below is a quick summary:
Difference #1 : Communication
Event Hub: 1 way communication from devices / sources
IoT Hub: Bi-directional communication between devices / sources
Difference #2 : Protocol
Event Hub: Limited protocol support — HTTPS, AMQP, AMQP
IoT Hub: Has additional — MQTT
Difference #3: Number of connections
Event Hub: Supports only up to 5000 connections simultaneously
IoT Hub: Supports > 5000 connections (Up to millions)
Difference #4: Security
Event Hub: Event Hub — wide identity using Shared Access Token (SAS)
Iot Hub: Each device has its own security credentials
Refer to the following links for more info:
Azure Data Factory - How to inspect schema of Avro files?
Azure Data Engineer Associate Certification Study Notes