Event Hub should have multiple partitions for availability

Medium Azure General eventhubs-event-hub-multiple-partitions

Applies to

  • Microsoft.EventHub/namespaces/eventhubs

What CGPulse checks

A resource passes this rule when partitionCount must be one of [2,4,8,16,32]. Anything else is reported as a finding with the evaluated property value attached as evidence.

How to fix it

Configure multiple partitions for better throughput and availability. In Azure Portal: Event Hub > Properties > verify partition count (set at creation). See: https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-scalability#partitions

CLI

az eventhubs eventhub show --ids "{id}" --query partitionCount

Bicep

resource eventHub 'Microsoft.EventHub/namespaces/eventhubs@2024-01-01' = {
  name: '{name}'
  parent: eventHubNamespace
  properties: {
    partitionCount: 4
    messageRetentionInDays: 7
  }
}

Terraform

resource "azurerm_eventhub" "{name}" {
  name                = "{name}"
  namespace_name      = "{parent}"
  resource_group_name = "{rg}"
  partition_count     = 4
  message_retention   = 7
}

Compliance frameworks

Is your environment compliant with this rule?

CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.

Run a free scan

Related Azure rules

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.