Communication Services - Link Notification Hub

Link Notification Hub
Links an Azure Notification Hub to this communication service.

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

URI Parameters

Name In Required Type Description
communicationServiceName
path True

string

The name of the CommunicationService resource.

Regex pattern: ^[-\w]+$

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.

Request Body

Name Required Type Description
connectionString True

string

Connection string for the notification hub

resourceId True

string

The resource ID of the notification hub

Responses

Name Type Description
200 OK

LinkedNotificationHub

Success. The notification hub has been linked.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Examples

Sample Request

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

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

Sample Response

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

Definitions

Name Description
ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

LinkedNotificationHub

A notification hub that has been linked to the communication service

LinkNotificationHubParameters

Description of an Azure Notification Hub to link to the communication service

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.

LinkedNotificationHub

A notification hub that has been linked to the communication service

Name Type Description
resourceId

string

The resource ID of the notification hub

LinkNotificationHubParameters

Description of an Azure Notification Hub to link to the communication service

Name Type Description
connectionString

string

Connection string for the notification hub

resourceId

string

The resource ID of the notification hub