Event Hubs - Create Or Update Authorization Rule

Creates or updates an AuthorizationRule for the specified Event Hub.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/eventhubs/{eventHubName}/authorizationRules/{authorizationRuleName}?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
location
  • string

Data center location.

name
  • string

Name of the AuthorizationRule.

rights True
  • string[]

The rights associated with the rule.

Responses

Name Type Description
200 OK

Event Hub AuthorizationRule successfully created.

Examples

EventHubAuthorizationRuleCreate

Sample Request

PUT 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?api-version=2015-08-01
{
  "properties": {
    "rights": [
      "Listen",
      "Send"
    ]
  }
}

Sample Response

{
  "id": "/subscriptions/e2f361f0-3b27-4503-a9cc-21cfba380093/resourceGroups/Default-ServiceBus-WestUS/providers/Microsoft.EventHub/namespaces/sdk-Namespace2290/eventhubs/sdk-EventHub8887/authorizationRules/sdk-Authrules9261",
  "name": "sdk-Authrules9261",
  "type": "Microsoft.EventHub/AuthorizationRules",
  "properties": {
    "rights": [
      "Listen",
      "Send"
    ]
  }
}

Definitions

Name Type Description
id
  • string

Resource Id

location
  • string

Resource location

name
  • string

Resource name

rights
  • string[]

The rights associated with the rule.

type
  • string

Resource type