You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/event-hubs/event-hubs-quickstart-cli.md
+93-26Lines changed: 93 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,60 +1,132 @@
1
1
---
2
-
title: Create an event hub using Azure CLI - Azure Event Hubs | Microsoft Docs
2
+
title: Quickstart - Create an event hub using Azure CLI
3
3
description: This quickstart describes how to create an event hub using Azure CLI and then send and receive events using Java.
4
4
ms.topic: quickstart
5
-
ms.date: 06/18/2021
5
+
ms.date: 03/13/2023
6
6
ms.author: spelluru
7
7
ms.custom: devx-track-azurecli, mode-api
8
8
---
9
9
10
10
# Quickstart: Create an event hub using Azure CLI
11
+
In this quickstart, you will create an event hub using Azure CLI.
11
12
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.
- This article requires version 2.0.4 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
21
19
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:
20
+
## Create a resource group
21
+
Run the following command to create a resource group. A resource group is a logical collection of Azure resources. All resources are deployed and managed in a resource group.
25
22
26
-
Set the current subscription context. Replace `MyAzureSub` with the name of the Azure subscription you want to use:
23
+
Select **Copy** to copy the command and paste it into the Cloud Shell or CLI window, and run it. Update the resource group name and the region if you like.
27
24
28
25
```azurecli-interactive
29
-
az account set --subscription MyAzureSub
30
-
```
31
-
32
-
## 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:
26
+
rgName="contosorg$RANDOM"
27
+
region="eastus"
28
+
az group create --name $rgName --location $region
29
+
```
34
30
35
-
```azurecli-interactive
36
-
# Create a resource group. Specify a name for the resource group.
37
-
az group create --name <resource group name> --location eastus
31
+
You see the output similar to the following one. You see the resource group name in the `name` field with a random number replacing `$RANDOM`.
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:
48
+
Run the following command to create an Event Hubs namespace. 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. Update the name of the namespace if you like.
42
49
43
50
```azurecli-interactive
44
51
# 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>
52
+
namespaceName="contosoehubns$RANDOM"
53
+
az eventhubs namespace create --name $namespaceName --resource-group $rgName -l $region
54
+
```
55
+
56
+
You see the output similar to the following one. You see the name of the namespace in the `name` field.
Congratulations! You have used Azure CLI to create an Event Hubs namespace, and an event hub within that namespace.
57
122
123
+
## Clean up resources
124
+
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.
125
+
126
+
```azurecli-interactive
127
+
az group delete --name $rgName
128
+
```
129
+
58
130
## Next steps
59
131
60
132
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:
@@ -66,8 +138,3 @@ In this article, you created a resource group, an Event Hubs namespace, and an e
Copy file name to clipboardExpand all lines: articles/event-hubs/event-hubs-quickstart-powershell.md
+97-22Lines changed: 97 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,60 +1,135 @@
1
1
---
2
-
title: 'Quickstart: Create an event hub using PowerShell - Azure Event Hubs'
2
+
title: 'Quickstart: Create an event hub using PowerShell'
3
3
description: This quickstart describes how to create an event hub using Azure PowerShell and then send and receive events using .NET Standard SDK.
4
4
ms.topic: quickstart
5
-
ms.date: 09/28/2021
5
+
ms.date: 03/13/2023
6
6
ms.custom: devx-track-azurepowershell, mode-api
7
7
---
8
8
9
9
# Quickstart: Create an event hub using Azure PowerShell
10
-
11
-
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).
12
-
13
10
In this quickstart, you create an event hub using Azure PowerShell.
If you're using PowerShell locally, you must run the latest version of PowerShell to complete this quickstart. If you need to install or upgrade, see [Install and Configure Azure PowerShell](/powershell/azure/install-az-ps).
28
18
29
19
## Create a resource group
20
+
Run the following command to create a resource group. A resource group is a logical collection of Azure resources. All resources are deployed and managed in a resource group.
30
21
31
-
A resource group is a logical collection of Azure resources, and you need a resource group to create an event hub.
22
+
If you're using Azure Cloud Shell, switch to **PowerShell** from **Bash** in the upper left corner. Select **Copy**to copy the command and paste it into the Cloud Shell, and run it.
32
23
33
-
The following example creates a resource group in the East US region. Replace `myResourceGroup` with the name of the resource group you want to use:
24
+
The following example creates a resource group in the East US region. Replace `myResourceGroup` with the name of the resource group you want to use.
Once your resource group is made, create an Event Hubs namespace within that resource group. An Event Hubs namespace provides a unique fully-qualified domain name in which you can create your event hub. Replace `namespace_name` with a unique name for your namespace:
42
+
Run the following command to create an Event Hubs namespace in the resource group. An Event Hubs namespace provides a unique fully qualified domain name in which you can create one or more event hubs. Update the value of the namespace if you like.
Congratulations! You have used Azure PowerShell to create an Event Hubs namespace, and an event hub within that namespace.
57
124
125
+
## Clean up resources
126
+
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.
127
+
128
+
```azurepowershell-interactive
129
+
Remove-AzResourceGroup $rgName
130
+
```
131
+
132
+
58
133
## Next steps
59
134
60
135
In this article, you created the Event Hubs namespace, and used sample applications to send and receive events from your 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:
0 commit comments