Skip to content

Latest commit

 

History

History
112 lines (74 loc) · 4.54 KB

event-hubs-bicep-namespace-event-hub.md

File metadata and controls

112 lines (74 loc) · 4.54 KB
title description author ms.topic ms.author ms.custom ms.date
Quickstart: Create an event hub with consumer group using Bicep - Azure Event Hubs
Quickstart: Create an Event Hubs namespace with an event hub and a consumer group using Bicep
spelluru
quickstart
spelluru
subject-armqs, mode-arm, devx-track-bicep
03/22/2022

Quickstart: Create an event hub by using Bicep

Azure Event Hubs is a Big Data streaming platform and event ingestion service, capable of receiving and processing millions of events per second. Event Hubs can process and store events, data, or telemetry produced by distributed software and devices. Data sent to an event hub can be transformed and stored using any real-time analytics provider or batching/storage adapters. For detailed overview of Event Hubs, see Event Hubs overview and Event Hubs features. In this quickstart, you create an event hub by using Bicep. You deploy a Bicep file to create a namespace of type Event Hubs, with one event hub.

[!INCLUDE About Bicep]

Prerequisites

If you don't have an Azure subscription, create a free account before you begin.

Review the Bicep file

The Bicep file used in this quickstart is from Azure Quickstart Templates.

:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.eventhub/eventhubs-create-namespace-and-eventhub/main.bicep":::

The resources defined in the Bicep file include:

Deploy the Bicep file

  1. Save the Bicep file as main.bicep to your local computer.

  2. Deploy the Bicep file using either Azure CLI or Azure PowerShell.

    az group create --name exampleRG --location eastus
    az deployment group create --resource-group exampleRG --template-file main.bicep --parameters projectName=<project-name>
    
    New-AzResourceGroup -Name exampleRG -Location eastus
    New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep -projectName "<project-name>"
    

    [!NOTE] Replace <project-name> with a project name. It will be used to generate the Event Hubs name and the Namespace name.

    When the deployment finishes, you should see a message indicating the deployment succeeded.

Validate the deployment

Use the Azure portal, Azure CLI, or Azure PowerShell to list the deployed resources in the resource group.

az resource list --resource-group exampleRG
Get-AzResource -ResourceGroupName exampleRG

Clean up resources

When no longer needed, use the Azure portal, Azure CLI, or Azure PowerShell to delete the VM and all of the resources in the resource group.

az group delete --name exampleRG
Remove-AzResourceGroup -Name exampleRG

Next steps

In this article, you created an Event Hubs namespace and an event hub in the namespace using Bicep. For step-by-step instructions to send events to (or) receive events from an event hub, see the Send and receive events tutorials: