Bicep resource definition
The namespaces/notificationHubs resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Usage Examples
Bicep Samples
A basic example of deploying Notification Hub within a Notification Hub Namespace.
param resourceName string = 'acctest0001'
param location string = 'westeurope'
resource namespace 'Microsoft.NotificationHubs/namespaces@2017-04-01' = {
name: resourceName
location: location
sku: {
name: 'Free'
}
properties: {
enabled: true
namespaceType: 'NotificationHub'
region: 'westeurope'
}
}
resource notificationHub 'Microsoft.NotificationHubs/namespaces/notificationHubs@2017-04-01' = {
name: resourceName
location: location
parent: namespace
properties: {}
}
Azure Quickstart Samples
The following Azure Quickstart templates contain Bicep samples for deploying this resource type.
To create a Microsoft.NotificationHubs/namespaces/notificationHubs resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.NotificationHubs/namespaces/notificationHubs@2016-03-01' = {
parent: resourceSymbolicName
location: 'string'
name: 'string'
properties: {
admCredential: {
properties: {
authTokenUrl: 'string'
clientId: 'string'
clientSecret: 'string'
}
}
apnsCredential: {
properties: {
apnsCertificate: 'string'
certificateKey: 'string'
endpoint: 'string'
thumbprint: 'string'
}
}
authorizationRules: [
{
rights: [
'string'
]
}
]
baiduCredential: {
properties: {
baiduApiKey: 'string'
baiduEndPoint: 'string'
baiduSecretKey: 'string'
}
}
gcmCredential: {
properties: {
gcmEndpoint: 'string'
googleApiKey: 'string'
}
}
mpnsCredential: {
properties: {
certificateKey: 'string'
mpnsCertificate: 'string'
thumbprint: 'string'
}
}
name: 'string'
registrationTtl: 'string'
wnsCredential: {
properties: {
packageSid: 'string'
secretKey: 'string'
windowsLiveEndpoint: 'string'
}
}
}
sku: {
capacity: int
family: 'string'
name: 'string'
size: 'string'
tier: 'string'
}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.NotificationHubs/namespaces/notificationHubs
| Name |
Description |
Value |
| location |
Resource location |
string (required) |
| name |
The resource name |
string (required) |
| parent |
In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.
For more information, see Child resource outside parent resource. |
Symbolic name for resource of type: namespaces |
| properties |
Properties of the NotificationHub. |
NotificationHubProperties (required) |
| sku |
The sku of the created namespace |
Sku |
| tags |
Resource tags |
Dictionary of tag names and values. See Tags in templates |
AdmCredential
AdmCredentialProperties
| Name |
Description |
Value |
| authTokenUrl |
The URL of the authorization token. |
string |
| clientId |
The client identifier. |
string |
| clientSecret |
The credential secret access key. |
string |
ApnsCredential
ApnsCredentialProperties
| Name |
Description |
Value |
| apnsCertificate |
The APNS certificate. |
string |
| certificateKey |
The certificate key. |
string |
| endpoint |
The endpoint of this credential. |
string |
| thumbprint |
The APNS certificate Thumbprint |
string |
BaiduCredential
BaiduCredentialProperties
| Name |
Description |
Value |
| baiduApiKey |
Baidu Api Key. |
string |
| baiduEndPoint |
Baidu Endpoint. |
string |
| baiduSecretKey |
Baidu Secret Key |
string |
GcmCredential
GcmCredentialProperties
| Name |
Description |
Value |
| gcmEndpoint |
The GCM endpoint. |
string |
| googleApiKey |
The Google API key. |
string |
MpnsCredential
MpnsCredentialProperties
| Name |
Description |
Value |
| certificateKey |
The certificate key for this credential. |
string |
| mpnsCertificate |
The MPNS certificate. |
string |
| thumbprint |
The MPNS certificate Thumbprint |
string |
NotificationHubProperties
| Name |
Description |
Value |
| admCredential |
The AdmCredential of the created NotificationHub |
AdmCredential |
| apnsCredential |
The ApnsCredential of the created NotificationHub |
ApnsCredential |
| authorizationRules |
The AuthorizationRules of the created NotificationHub |
SharedAccessAuthorizationRuleProperties[] |
| baiduCredential |
The BaiduCredential of the created NotificationHub |
BaiduCredential |
| gcmCredential |
The GcmCredential of the created NotificationHub |
GcmCredential |
| mpnsCredential |
The MpnsCredential of the created NotificationHub |
MpnsCredential |
| name |
The NotificationHub name. |
string |
| registrationTtl |
The RegistrationTtl of the created NotificationHub |
string |
| wnsCredential |
The WnsCredential of the created NotificationHub |
WnsCredential |
SharedAccessAuthorizationRuleProperties
| Name |
Description |
Value |
| rights |
The rights associated with the rule. |
String array containing any of: 'Listen' 'Manage' 'Send' |
Sku
| Name |
Description |
Value |
| capacity |
The capacity of the resource |
int |
| family |
The Sku Family |
string |
| name |
Name of the notification hub sku |
'Basic' 'Free' 'Standard' (required) |
| size |
The Sku size |
string |
| tier |
The tier of particular sku |
string |
WnsCredential
WnsCredentialProperties
| Name |
Description |
Value |
| packageSid |
The package ID for this credential. |
string |
| secretKey |
The secret key. |
string |
| windowsLiveEndpoint |
The Windows Live endpoint. |
string |
ARM template resource definition
The namespaces/notificationHubs resource type can be deployed with operations that target:
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
To create a Microsoft.NotificationHubs/namespaces/notificationHubs resource, add the following JSON to your template.
{
"type": "Microsoft.NotificationHubs/namespaces/notificationHubs",
"apiVersion": "2016-03-01",
"name": "string",
"location": "string",
"properties": {
"admCredential": {
"properties": {
"authTokenUrl": "string",
"clientId": "string",
"clientSecret": "string"
}
},
"apnsCredential": {
"properties": {
"apnsCertificate": "string",
"certificateKey": "string",
"endpoint": "string",
"thumbprint": "string"
}
},
"authorizationRules": [
{
"rights": [ "string" ]
}
],
"baiduCredential": {
"properties": {
"baiduApiKey": "string",
"baiduEndPoint": "string",
"baiduSecretKey": "string"
}
},
"gcmCredential": {
"properties": {
"gcmEndpoint": "string",
"googleApiKey": "string"
}
},
"mpnsCredential": {
"properties": {
"certificateKey": "string",
"mpnsCertificate": "string",
"thumbprint": "string"
}
},
"name": "string",
"registrationTtl": "string",
"wnsCredential": {
"properties": {
"packageSid": "string",
"secretKey": "string",
"windowsLiveEndpoint": "string"
}
}
},
"sku": {
"capacity": "int",
"family": "string",
"name": "string",
"size": "string",
"tier": "string"
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.NotificationHubs/namespaces/notificationHubs
| Name |
Description |
Value |
| apiVersion |
The api version |
'2016-03-01' |
| location |
Resource location |
string (required) |
| name |
The resource name |
string (required) |
| properties |
Properties of the NotificationHub. |
NotificationHubProperties (required) |
| sku |
The sku of the created namespace |
Sku |
| tags |
Resource tags |
Dictionary of tag names and values. See Tags in templates |
| type |
The resource type |
'Microsoft.NotificationHubs/namespaces/notificationHubs' |
AdmCredential
AdmCredentialProperties
| Name |
Description |
Value |
| authTokenUrl |
The URL of the authorization token. |
string |
| clientId |
The client identifier. |
string |
| clientSecret |
The credential secret access key. |
string |
ApnsCredential
ApnsCredentialProperties
| Name |
Description |
Value |
| apnsCertificate |
The APNS certificate. |
string |
| certificateKey |
The certificate key. |
string |
| endpoint |
The endpoint of this credential. |
string |
| thumbprint |
The APNS certificate Thumbprint |
string |
BaiduCredential
BaiduCredentialProperties
| Name |
Description |
Value |
| baiduApiKey |
Baidu Api Key. |
string |
| baiduEndPoint |
Baidu Endpoint. |
string |
| baiduSecretKey |
Baidu Secret Key |
string |
GcmCredential
GcmCredentialProperties
| Name |
Description |
Value |
| gcmEndpoint |
The GCM endpoint. |
string |
| googleApiKey |
The Google API key. |
string |
MpnsCredential
MpnsCredentialProperties
| Name |
Description |
Value |
| certificateKey |
The certificate key for this credential. |
string |
| mpnsCertificate |
The MPNS certificate. |
string |
| thumbprint |
The MPNS certificate Thumbprint |
string |
NotificationHubProperties
| Name |
Description |
Value |
| admCredential |
The AdmCredential of the created NotificationHub |
AdmCredential |
| apnsCredential |
The ApnsCredential of the created NotificationHub |
ApnsCredential |
| authorizationRules |
The AuthorizationRules of the created NotificationHub |
SharedAccessAuthorizationRuleProperties[] |
| baiduCredential |
The BaiduCredential of the created NotificationHub |
BaiduCredential |
| gcmCredential |
The GcmCredential of the created NotificationHub |
GcmCredential |
| mpnsCredential |
The MpnsCredential of the created NotificationHub |
MpnsCredential |
| name |
The NotificationHub name. |
string |
| registrationTtl |
The RegistrationTtl of the created NotificationHub |
string |
| wnsCredential |
The WnsCredential of the created NotificationHub |
WnsCredential |
SharedAccessAuthorizationRuleProperties
| Name |
Description |
Value |
| rights |
The rights associated with the rule. |
String array containing any of: 'Listen' 'Manage' 'Send' |
Sku
| Name |
Description |
Value |
| capacity |
The capacity of the resource |
int |
| family |
The Sku Family |
string |
| name |
Name of the notification hub sku |
'Basic' 'Free' 'Standard' (required) |
| size |
The Sku size |
string |
| tier |
The tier of particular sku |
string |
WnsCredential
WnsCredentialProperties
| Name |
Description |
Value |
| packageSid |
The package ID for this credential. |
string |
| secretKey |
The secret key. |
string |
| windowsLiveEndpoint |
The Windows Live endpoint. |
string |
The namespaces/notificationHubs resource type can be deployed with operations that target:
- Resource groups
For a list of changed properties in each API version, see change log.
Usage Examples
A basic example of deploying Notification Hub within a Notification Hub Namespace.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "namespace" {
type = "Microsoft.NotificationHubs/namespaces@2017-04-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
enabled = true
namespaceType = "NotificationHub"
region = "westeurope"
}
sku = {
name = "Free"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "notificationHub" {
type = "Microsoft.NotificationHubs/namespaces/notificationHubs@2017-04-01"
parent_id = azapi_resource.namespace.id
name = var.resource_name
location = var.location
body = {
properties = {
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
To create a Microsoft.NotificationHubs/namespaces/notificationHubs resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.NotificationHubs/namespaces/notificationHubs@2016-03-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
admCredential = {
properties = {
authTokenUrl = "string"
clientId = "string"
clientSecret = "string"
}
}
apnsCredential = {
properties = {
apnsCertificate = "string"
certificateKey = "string"
endpoint = "string"
thumbprint = "string"
}
}
authorizationRules = [
{
rights = [
"string"
]
}
]
baiduCredential = {
properties = {
baiduApiKey = "string"
baiduEndPoint = "string"
baiduSecretKey = "string"
}
}
gcmCredential = {
properties = {
gcmEndpoint = "string"
googleApiKey = "string"
}
}
mpnsCredential = {
properties = {
certificateKey = "string"
mpnsCertificate = "string"
thumbprint = "string"
}
}
name = "string"
registrationTtl = "string"
wnsCredential = {
properties = {
packageSid = "string"
secretKey = "string"
windowsLiveEndpoint = "string"
}
}
}
sku = {
capacity = int
family = "string"
name = "string"
size = "string"
tier = "string"
}
}
}
Property Values
Microsoft.NotificationHubs/namespaces/notificationHubs
| Name |
Description |
Value |
| location |
Resource location |
string (required) |
| name |
The resource name |
string (required) |
| parent_id |
The ID of the resource that is the parent for this resource. |
ID for resource of type: namespaces |
| properties |
Properties of the NotificationHub. |
NotificationHubProperties (required) |
| sku |
The sku of the created namespace |
Sku |
| tags |
Resource tags |
Dictionary of tag names and values. |
| type |
The resource type |
"Microsoft.NotificationHubs/namespaces/notificationHubs@2016-03-01" |
AdmCredential
AdmCredentialProperties
| Name |
Description |
Value |
| authTokenUrl |
The URL of the authorization token. |
string |
| clientId |
The client identifier. |
string |
| clientSecret |
The credential secret access key. |
string |
ApnsCredential
ApnsCredentialProperties
| Name |
Description |
Value |
| apnsCertificate |
The APNS certificate. |
string |
| certificateKey |
The certificate key. |
string |
| endpoint |
The endpoint of this credential. |
string |
| thumbprint |
The APNS certificate Thumbprint |
string |
BaiduCredential
BaiduCredentialProperties
| Name |
Description |
Value |
| baiduApiKey |
Baidu Api Key. |
string |
| baiduEndPoint |
Baidu Endpoint. |
string |
| baiduSecretKey |
Baidu Secret Key |
string |
GcmCredential
GcmCredentialProperties
| Name |
Description |
Value |
| gcmEndpoint |
The GCM endpoint. |
string |
| googleApiKey |
The Google API key. |
string |
MpnsCredential
MpnsCredentialProperties
| Name |
Description |
Value |
| certificateKey |
The certificate key for this credential. |
string |
| mpnsCertificate |
The MPNS certificate. |
string |
| thumbprint |
The MPNS certificate Thumbprint |
string |
NotificationHubProperties
| Name |
Description |
Value |
| admCredential |
The AdmCredential of the created NotificationHub |
AdmCredential |
| apnsCredential |
The ApnsCredential of the created NotificationHub |
ApnsCredential |
| authorizationRules |
The AuthorizationRules of the created NotificationHub |
SharedAccessAuthorizationRuleProperties[] |
| baiduCredential |
The BaiduCredential of the created NotificationHub |
BaiduCredential |
| gcmCredential |
The GcmCredential of the created NotificationHub |
GcmCredential |
| mpnsCredential |
The MpnsCredential of the created NotificationHub |
MpnsCredential |
| name |
The NotificationHub name. |
string |
| registrationTtl |
The RegistrationTtl of the created NotificationHub |
string |
| wnsCredential |
The WnsCredential of the created NotificationHub |
WnsCredential |
SharedAccessAuthorizationRuleProperties
| Name |
Description |
Value |
| rights |
The rights associated with the rule. |
String array containing any of: 'Listen' 'Manage' 'Send' |
Sku
| Name |
Description |
Value |
| capacity |
The capacity of the resource |
int |
| family |
The Sku Family |
string |
| name |
Name of the notification hub sku |
'Basic' 'Free' 'Standard' (required) |
| size |
The Sku size |
string |
| tier |
The tier of particular sku |
string |
WnsCredential
WnsCredentialProperties
| Name |
Description |
Value |
| packageSid |
The package ID for this credential. |
string |
| secretKey |
The secret key. |
string |
| windowsLiveEndpoint |
The Windows Live endpoint. |
string |