Hello @Klinemeier, Kevin (624),
welcome to this moderated Azure community forum.
An eventhub lives inside an eventhub namespace.
Here is a possible CLI example flow after you have logged in:
az login
First we need a resource group:
az group create --name acsResourceGroup --location westeurope
Notice that when you're prompted about a CLI extension for an extension, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.
Try creating a standard size Event Hub Namespace, living inside a resourcegroup:
az eventhubs namespace create --name acs-eventprocessor-service-ehns --resource-group acsResourceGroup -l westeurope --sku Standard
This Event Hub namespace is empty so let’s add an Event Hub:
az eventhubs eventhub create --name messages --resource-group acsResourceGroup --namespace-name acs-eventprocessor-service-ehns --partition-count 4
It is wise to use specific consumer groups for consumers so add a consumer group named ‘aci’:
az eventhubs eventhub consumer-group create --consumer-group-name aci --eventhub-name messages --namespace-name acs-eventprocessor-service-ehns --resource-group acsResourceGroup
To get the connection strings, you can list them:
az eventhubs namespace authorization-rule keys list --resource-group acsResourceGroup --namespace-name acs-eventprocessor-service-ehns --name RootManageSharedAccessKey
To get only the primary key, try:
PRIMARYCONNSTRING=$(az eventhubs namespace authorization-rule keys list --resource-group acsResourceGroup --namespace-name acs-eventprocessor-service-ehns --name RootManageShared
AccessKey --query primaryConnectionString --output tsv)
echo $PRIMARYCONNSTRING
This should give you a head start.
Please check this documentation too for more examples.
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.