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=2025-05-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
communication
|
path | True |
string minLength: 1maxLength: 63 pattern: ^[-\w]+$ |
The name of the CommunicationService resource. |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
api-version
|
query | True |
string minLength: 1 |
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 |
Success. The notification hub has been linked. |
|
| Other Status Codes |
Error response describing why the operation failed. |
Examples
Link notification hub
Sample request
POST https://management.azure.com/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/MyResourceGroup/providers/Microsoft.Communication/communicationServices/MyCommunicationResource/linkNotificationHub?api-version=2025-05-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"
}
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 |
|---|---|
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Linked |
A notification hub that has been linked to the communication service |
|
Link |
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 |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
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 |