Skip to content

Commit db9759e

Browse files
committed
Event Hubs quickstarts
1 parent d2eafb5 commit db9759e

File tree

1 file changed

+20
-33
lines changed

1 file changed

+20
-33
lines changed
Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,60 @@
11
---
2-
title: Create an event hub using Azure CLI - Azure Event Hubs | Microsoft Docs
2+
title: Quickstart - Create an event hub using Azure CLI
33
description: This quickstart describes how to create an event hub using Azure CLI and then send and receive events using Java.
44
ms.topic: quickstart
5-
ms.date: 06/18/2021
5+
ms.date: 03/13/2023
66
ms.author: spelluru
77
ms.custom: devx-track-azurecli, mode-api
88
---
99

1010
# Quickstart: Create an event hub using Azure CLI
11+
In this quickstart, you will create an event hub using Azure CLI.
1112

12-
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](event-hubs-about.md) and [Event Hubs features](event-hubs-features.md).
13-
14-
In this quickstart, you create an event hub using Azure CLI.
1513

1614
[!INCLUDE [quickstarts-free-trial-note](../../includes/quickstarts-free-trial-note.md)]
1715

1816
[!INCLUDE [azure-cli-prepare-your-environment.md](~/articles/reusable-content/azure-cli/azure-cli-prepare-your-environment.md)]
1917

2018
- This article requires version 2.0.4 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
2119

22-
## Set the subscription context
23-
24-
The following steps are not required if you're running commands in Cloud Shell. If you're running the CLI locally, perform the following steps to sign in to Azure and set your current subscription:
25-
26-
Set the current subscription context. Replace `MyAzureSub` with the name of the Azure subscription you want to use:
27-
28-
```azurecli-interactive
29-
az account set --subscription MyAzureSub
30-
```
31-
3220
## Create a resource group
33-
A resource group is a logical collection of Azure resources. All resources are deployed and managed in a resource group. Run the following command to create a resource group:
21+
A resource group is a logical collection of Azure resources. All resources are deployed and managed in a resource group. Run the following command to create a resource group. Select **Copy** to copy the command and paste it into the Cloud Shell, and run it.
3422

3523
```azurecli-interactive
36-
# Create a resource group. Specify a name for the resource group.
37-
az group create --name <resource group name> --location eastus
24+
rgName="contosorg$RANDOM"
25+
region="eastus"
26+
az group create --name $rgName --location $region
3827
```
3928

4029
## Create an Event Hubs namespace
4130
An Event Hubs namespace provides a unique scoping container, referenced by its fully qualified domain name, in which you create one or more event hubs. To create a namespace in your resource group, run the following command:
4231

4332
```azurecli-interactive
4433
# Create an Event Hubs namespace. Specify a name for the Event Hubs namespace.
45-
az eventhubs namespace create --name <Event Hubs namespace> --resource-group <resource group name> -l <region, for example: East US>
34+
namespaceName="contosoehubns$RANDOM"
35+
az eventhubs namespace create --name $namespaceName --resource-group $rgName -l $region
4636
```
4737

4838
## Create an event hub
4939
Run the following command to create an event hub:
5040

5141
```azurecli-interactive
5242
# Create an event hub. Specify a name for the event hub.
53-
az eventhubs eventhub create --name <event hub name> --resource-group <resource group name> --namespace-name <Event Hubs namespace>
43+
eventhubName="contosoehub$RANDOM"
44+
az eventhubs eventhub create --name $eventhubName --resource-group $rgName --namespace-name $namespaceName
5445
```
5546

5647
Congratulations! You have used Azure CLI to create an Event Hubs namespace, and an event hub within that namespace.
5748

58-
## Next steps
49+
## Clean up resources
50+
If you want to keep this event hub so that you can test sending and receiving events, ignore this section. Otherwise, run the following command to delete the resource group. This command deletes all the resources in the resource group and the resource group itself.
5951

60-
In this article, you created a resource group, an Event Hubs namespace, and an event hub. For step-by-step instructions to send events to (or) receive events from an event hub, see the **Send and receive events** tutorials:
52+
```azurecli-interactive
53+
az group delete --name $rgName
54+
```
55+
56+
## Next steps
6157

62-
- [.NET Core](event-hubs-dotnet-standard-getstarted-send.md)
63-
- [Java](event-hubs-java-get-started-send.md)
64-
- [Python](event-hubs-python-get-started-send.md)
65-
- [JavaScript](event-hubs-node-get-started-send.md)
66-
- [Go](event-hubs-go-get-started-send.md)
67-
- [C (send only)](event-hubs-c-getstarted-send.md)
68-
- [Apache Storm (receive only)](event-hubs-storm-getstarted-receive.md)
58+
> [!div class="nextstepaction"]
59+
> In this article, you created a resource group, an Event Hubs namespace, and an event hub. For step-by-step instructions to send events to (or) receive events from an event hub, see the **Send and receive events** tutorials: [.NET Core](event-hubs-dotnet-standard-getstarted-send.md), [Java](event-hubs-java-get-started-send.md), [Python](event-hubs-python-get-started-send.md), [JavaScript](event-hubs-node-get-started-send.md), [Go](event-hubs-go-get-started-send.md), [C (send only)](event-hubs-c-getstarted-send.md), [Apache Storm (receive only)](event-hubs-storm-getstarted-receive.md)
6960
70-
[create a free account]: https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio
71-
[Install the Azure CLI]: /cli/azure/install-azure-cli
72-
[az group create]: /cli/azure/group#az_group_create
73-
[fully qualified domain name]: https://wikipedia.org/wiki/Fully_qualified_domain_name

0 commit comments

Comments
 (0)