Configuring an Azure Event Hubs Namespace
This tutorial guides you through the process of creating and configuring a new Azure Event Hubs namespace. A namespace is a logical container for your Event Hubs resources, such as event hubs and consumer groups.
Prerequisites
- An Azure account with an active subscription. If you don't have one, you can create a free account.
- Appropriate permissions to create resources within your Azure subscription.
Log in to the Azure portal.
- In the Azure portal search bar, type "Event Hubs" and select "Event Hubs" from the services list.
- Click the + Create button or the Create namespace button.
- In the "Create namespace" page, select the subscription and resource group you want to use. If you don't have a resource group, you can create a new one.
- Enter a unique name for your Event Hubs namespace. This name must be globally unique across Azure.
- Select the region where you want to deploy your namespace.
- Choose the Pricing tier. For testing and development, the "Basic" tier is often sufficient. For production workloads, consider "Standard" or "Premium".
- Review the other settings, such as networking and availability zones, and configure them as needed. For this tutorial, the default settings are usually fine.
- Click the Review + create button.
- Once the validation passes, click Create.
Deployment may take a few minutes. You will receive a notification when the deployment is complete.
- After deployment, navigate to your newly created Event Hubs namespace. You can find it by searching for its name in the Azure portal.
- On the namespace overview page, you'll see key information such as the namespace URI, status, and resource group.
Throughput Units (Standard Tier)
If you chose the Standard tier, you can configure throughput units (TUs). TUs determine the ingress and egress throughput for your namespace. You can adjust these based on your expected workload.
Navigate to Settings -> Scale out within your namespace.
Networking
You can configure network access to your namespace for enhanced security:
- Public access: Allows access from any IP address (can be restricted).
- Private endpoints: For secure access from within your virtual network.
- IP filtering: Restrict access to specific IP addresses or ranges.
Navigate to Settings -> Networking to configure these options.
Shared Access Policies (SAS)
Shared Access Signatures (SAS) provide a way to grant clients access to your Event Hubs namespace with specific permissions (Listen, Send, Manage).
Navigate to Settings -> Shared access policies. You can use the default RootManageSharedAccessKey for initial development, but it's recommended to create more granular policies for production environments.
# Example of a SAS token (DO NOT expose sensitive keys)
# SharedAccessSignature sa=sr%3a%2f%2f....%2feventhubs%2fmyhubs%3anamespace%3dmyevents&sig=AbCdEfGhIjKlMnOpQrStUvWxYz1234567890%3D&se=1678886400
Diagnostic Settings
Configure diagnostic settings to send metrics and logs to Azure Monitor, Log Analytics workspaces, or storage accounts for monitoring and troubleshooting.
Navigate to Monitoring -> Diagnostic settings.
Next Steps
With your Event Hubs namespace configured, you are ready to create event hubs and start sending and receiving data. You can proceed to the next tutorial on Creating an Event Hub.