Cloud · Azure Data Engineering

Azure Event Hubs capture to ADLS Gen2 and consumer groups

azureMediumazureevent-hubsadls-gen2streaming

Interview question

How do you configure Event Hubs Capture and consumer groups for multi-engine streaming ingestion?

How to answer

The short answer

Azure Event Hubs is a fully managed, real-time data ingestion service capable of processing millions of streaming events per second with low latency. In lakehouse architectures, teams often need to store raw event streams into Azure Data Lake Storage Gen2 for batch auditing while simultaneously processing them in real time.

Automated lake ingestion with Event Hubs Capture

Instead of writing and maintaining custom streaming consumer jobs merely to write raw records into storage, enable Event Hubs Capture.

Capture is a native feature that automatically writes streaming events directly into an ADLS Gen2 container in Avro or Parquet format:

  • You configure a time window (between 1 and 15 minutes) or a size threshold (between 10 MB and 500 MB).
  • Whenever either threshold is met, Event Hubs packages buffered events and writes a compressed file to a structured date-partitioned storage hierarchy ({Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}).
  • Capture operates as an internal background process that consumes zero throughput units (TUs) from your active stream processing capacity.

Consumer group isolation

In enterprise platforms, multiple downstream applications frequently need to read the same telemetry stream independently:

  • A real-time Azure Stream Analytics job detects immediate system anomalies.
  • An Azure Databricks Spark Structured Streaming notebook computes rolling window aggregations.
  • An operational alerting service monitors critical error codes.

To prevent these engines from competing for read pointers, assign each application a dedicated .

Each consumer group maintains its own independent offset state across all partitions. Application A can lag behind by 30 minutes without slowing down or blocking Application B.