Azure Event Hubs Documentation

How to Manage Azure Event Hubs

This guide covers common operations for managing your Azure Event Hubs, including creating, updating, and deleting Event Hubs, as well as configuring their properties.

Prerequisites

Managing Event Hubs using the Azure Portal

The Azure portal provides a user-friendly interface for managing your Event Hubs.

  1. Navigate to your Event Hubs namespace in the Azure portal.
  2. In the left-hand menu, under "Entity Management", click on "Event Hubs".
  3. You will see a list of existing Event Hubs. You can click on an Event Hub to view and manage its specific settings.

Creating an Event Hub

To create a new Event Hub:

  1. Go to your Event Hubs namespace in the Azure portal.
  2. Click the "+ Event Hub" button.
  3. Enter a name for your Event Hub.
  4. Configure settings such as the number of partitions and message retention period.
  5. Click "Create".

Configuring Event Hub Properties

Once an Event Hub is created, you can modify its settings:

Message Retention

The message retention period determines how long Event Hubs retains data. This can be configured from 1 to 7 days.

Consider your data processing needs and compliance requirements when setting the retention period. Longer retention can increase storage costs.

Partitions

Partitions are a fundamental concept for scaling Event Hubs. You can increase the number of partitions up to the maximum allowed for your tier. Decreasing partitions is not supported after creation.


# Example: Increasing partitions (conceptually, done via portal/API)
# Note: This operation might require a brief interruption or careful planning.
# Always check Azure documentation for the exact procedure and limitations.
            

Managing Event Hubs using Azure CLI

You can also manage Event Hubs programmatically using the Azure CLI.

Create an Event Hub


az eventhubs event-hub create --name  \
                             --namespace-name  \
                             --resource-group  \
                             --partition-count  \
                             --message-retention 
            

List Event Hubs


az eventhubs event-hub list --namespace-name  \
                           --resource-group 
            

Delete an Event Hub


az eventhubs event-hub delete --name  \
                             --namespace-name  \
                             --resource-group 
            
Deleting an Event Hub is a permanent action and cannot be undone. Ensure you have backups or necessary data if required.

Managing Event Hubs using Azure SDKs

For more complex management tasks or integration into applications, use the Azure SDKs for your preferred programming language (e.g., Python, .NET, Java, Node.js).

Refer to the API Reference for detailed information on available management operations.

Best Practices