Event Hubs - Regenerate Keys

Regenerates the ACS and SAS connection strings for the Event Hub.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}/regenerateKeys?api-version={api-version}

URI Parameters

Name In Required Type Description
consumerGroupName
path True
  • string
The consumer group name
subscriptionId
path True
  • string

Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

resourceGroupName
path True
  • string

Name of the resource group within the azure subscription.

namespaceName
path True
  • string

The Namespace name

eventHubName
path True
  • string

The Event Hub name

authorizationRuleName
path True
  • string

The authorization rule name.

api-version
query True
  • string

Client API Version.

Request Body

Name Required Type Description
policykey
  • enum:
    • PrimaryKey
    • SecondaryKey

Key that needs to be regenerated.

Responses

Name Type Description
200 OK

Connection strings successfully regenerated.

Examples

EventHubAuthorizationRuleRegenrateKey

Sample Request

POST https://management.azure.com/subscriptions/e2f361f0-3b27-4503-a9cc-21cfba380093/resourceGroups/Default-ServiceBus-WestUS/providers/Microsoft.EventHub/namespaces/sdk-namespace2290./eventhubs/sdk-EventHub8887/authorizationRules/sdk-Authrules9261/regenerateKeys?api-version=2015-08-01
{
  "policykey": "PrimaryKey"
}

Sample Response

{
  "primaryConnectionString": "Endpoint=sb://sdk-namespace2290.servicebus.windows.net/;SharedAccessKeyName=sdk-Authrules9261;SharedAccessKey=############################;EntityPath=sdk-EventHub8887",
  "secondaryConnectionString": "Endpoint=sb://sdk-namespace2290.servicebus.windows.net/;SharedAccessKeyName=sdk-Authrules9261;SharedAccessKey=############################;EntityPath=sdk-EventHub8887",
  "primaryKey": "############################",
  "secondaryKey": "############################",
  "keyName": "sdk-Authrules9261"
}

Definitions

Name Type Description
keyName
  • string

A string that describes the AuthorizationRule.

primaryConnectionString
  • string

Primary connection string of the created Namespace AuthorizationRule.

primaryKey
  • string

A base64-encoded 256-bit primary key for signing and validating the SAS token.

secondaryConnectionString
  • string

Secondary connection string of the created Namespace AuthorizationRule.

secondaryKey
  • string

A base64-encoded 256-bit primary key for signing and validating the SAS token.