Share via


Namespaces - List Shared Access Keys

List keys for a namespace.
List the two keys used to publish to a namespace.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/namespaces/{namespaceName}/listKeys?api-version=2025-02-15

URI Parameters

Name In Required Type Description
namespaceName
path True

string

minLength: 3
maxLength: 50
pattern: ^[a-zA-Z0-9-]*$

Name of the namespace.

resourceGroupName
path True

string

The name of the resource group within the user's subscription.

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.

api-version
query True

string

Version of the API to be used with the client request.

Responses

Name Type Description
200 OK

NamespaceSharedAccessKeys

OK

Other Status Codes

ErrorResponse

Error response returned if request was unsuccessful.

Examples

Namespaces_ListSharedAccessKeys

Sample request

POST https://management.azure.com/subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/namespaces/exampleNamespaceName1/listKeys?api-version=2025-02-15

Sample response

{
  "key1": "testKey1Value",
  "key2": "testKey2Value"
}

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

NamespaceSharedAccessKeys

Shared access keys of the Namespace.

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.

NamespaceSharedAccessKeys

Shared access keys of the Namespace.

Name Type Description
key1

string

Shared access key1 for the namespace.

key2

string

Shared access key2 for the namespace.