你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Namespaces - List Keys

获取命名空间的主连接和辅助 ConnectionString。

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

URI 参数

名称 必需 类型 说明
authorizationRuleName
path True

string

授权规则名称

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

namespaceName
path True

string

命名空间名称

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

resourceGroupName
path True

string

资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string

uuid

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

要用于此操作的 API 版本。

响应

名称 类型 说明
200 OK

ResourceListKeys

成功

Other Status Codes

ErrorResponse

错误代码和原因。

安全性

azure_auth

Azure Active Directory OAuth2 流

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

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

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"
}

定义

名称 说明
ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

ResourceListKeys

对 POST 请求的响应,该请求返回命名空间或 NotificationHub 访问密钥 (连接字符串) 。

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

ResourceListKeys

对 POST 请求的响应,该请求返回命名空间或 NotificationHub 访问密钥 (连接字符串) 。

名称 类型 说明
keyName

string

获取或设置创建的 AuthorizationRule 的 keyName

primaryConnectionString

string

获取或设置 AuthorizationRule 的 primaryConnectionString。

primaryKey

string

获取或设置创建的 AuthorizationRule 的 primaryKey。

secondaryConnectionString

string

获取或设置创建的 AuthorizationRule 的 secondaryConnectionString

secondaryKey

string

获取或设置创建的 AuthorizationRule 的 secondaryKey