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

Communication Services - Link Notification Hub

链接通知中心
将 Azure 通知中心链接到此通信服务。

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Communication/communicationServices/{communicationServiceName}/linkNotificationHub?api-version=2023-04-01

URI 参数

名称 必需 类型 说明
communicationServiceName
path True

string

CommunicationService 资源的名称。

正则表达式模式: ^[-\w]+$

resourceGroupName
path True

string

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

subscriptionId
path True

string

uuid

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

api-version
query True

string

用于此操作的 API 版本。

请求正文

名称 必需 类型 说明
connectionString True

string

通知中心的连接字符串

resourceId True

string

通知中心的资源 ID

响应

名称 类型 说明
200 OK

LinkedNotificationHub

成功。 通知中心已链接。

Other Status Codes

ErrorResponse

描述操作失败的原因的错误响应。

示例

示例请求

POST https://management.azure.com/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/communicationServices/MyCommunicationResource/linkNotificationHub?api-version=2023-04-01

{
  "resourceId": "/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyOtherResourceGroup/providers/Microsoft.NotificationHubs/namespaces/MyNamespace/notificationHubs/MyHub",
  "connectionString": "Endpoint=sb://MyNamespace.servicebus.windows.net/;SharedAccessKey=abcd1234"
}

示例响应

{
  "resourceId": "/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyOtherResourceGroup/providers/Microsoft.NotificationHubs/namespaces/MyNamespace/notificationHubs/MyHub"
}
{
  "error": {
    "code": "WrongSubscription",
    "message": "The notification hub must be in the same subscription as the communication service"
  }
}

定义

名称 说明
ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

LinkedNotificationHub

已链接到通信服务的通知中心

LinkNotificationHubParameters

用于链接到通信服务的 Azure 通知中心的说明

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

LinkedNotificationHub

已链接到通信服务的通知中心

名称 类型 说明
resourceId

string

通知中心的资源 ID

LinkNotificationHubParameters

用于链接到通信服务的 Azure 通知中心的说明

名称 类型 说明
connectionString

string

通知中心的连接字符串

resourceId

string

通知中心的资源 ID