Namespaces - List Keys

Gets the Primary and Secondary ConnectionStrings to the namespace.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/authorizationRules/{authorizationRuleName}/listKeys?api-version=2023-09-01

URI Parameters

Name In Required Type Description
authorizationRuleName
path True

string

Authorization Rule Name

Regex pattern: ^[a-zA-Z0-9!()*-._]+$

namespaceName
path True

string

Namespace name

Regex pattern: ^[a-zA-Z][a-zA-Z0-9-]*$

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

uuid

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

The API version to use for this operation.

Responses

Name Type Description
200 OK

ResourceListKeys

Success

Other Status Codes

ErrorResponse

Error code with reason.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Namespaces_ListKeys

Sample request

POST https://management.azure.com/subscriptions/29cfa613-cbbc-4512-b1d6-1b3a92c7fa40/resourceGroups/5ktrial/providers/Microsoft.NotificationHubs/namespaces/nh-sdk-ns/authorizationRules/RootManageSharedAccessKey/listKeys?api-version=2023-09-01

Sample response

{
  "primaryConnectionString": "Endpoint=sb://nh-sdk-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=############################################",
  "secondaryConnectionString": "Endpoint=sb://nh-sdk-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=############################################",
  "primaryKey": "############################################",
  "secondaryKey": "############################################",
  "keyName": "RootManageSharedAccessKey"
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ResourceListKeys

Response for the POST request that returns Namespace or NotificationHub access keys (connection strings).

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ResourceListKeys

Response for the POST request that returns Namespace or NotificationHub access keys (connection strings).

Name Type Description
keyName

string

Gets or sets keyName of the created AuthorizationRule

primaryConnectionString

string

Gets or sets primaryConnectionString of the AuthorizationRule.

primaryKey

string

Gets or sets primaryKey of the created AuthorizationRule.

secondaryConnectionString

string

Gets or sets secondaryConnectionString of the created AuthorizationRule

secondaryKey

string

Gets or sets secondaryKey of the created AuthorizationRule