Microsoft.NotificationHubs namespaces/notificationHubs/authorizationRules

Bicep resource definition

The namespaces/notificationHubs/authorizationRules 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 Authorization Rule associated with a 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: {}
}

resource authorizationRule 'Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules@2017-04-01' = {
  name: resourceName
  parent: notificationHub
  properties: {
    rights: [
      'Listen'
    ]
  }
}

Resource format

To create a Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules resource, add the following Bicep to your template.

resource symbolicname 'Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules@2023-10-01-preview' = {
  parent: resourceSymbolicName
  location: 'string'
  name: 'string'
  properties: {
    primaryKey: 'string'
    rights: [
      'string'
    ]
    secondaryKey: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

Property Values

Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules

Name Description Value
location string
name The resource name string

Constraints:
Min length = 1
Max length = 256
Pattern = ^[a-zA-Z0-9!()*-._]+$ (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/notificationHubs
properties SharedAccessAuthorizationRule properties. SharedAccessAuthorizationRuleProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates

SharedAccessAuthorizationRuleProperties

Name Description Value
primaryKey Gets a base64-encoded 256-bit primary key for signing and
validating the SAS token.
string

Constraints:
Sensitive value. Pass in as a secure parameter.
rights Gets or sets the rights associated with the rule. String array containing any of:
'Listen'
'Manage'
'Send' (required)
secondaryKey Gets a base64-encoded 256-bit primary key for signing and
validating the SAS token.
string

Constraints:
Sensitive value. Pass in as a secure parameter.

SharedAccessAuthorizationRuleResourceTags

Name Description Value

ARM template resource definition

The namespaces/notificationHubs/authorizationRules resource type can be deployed with operations that target:

Usage Examples

Resource format

To create a Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules resource, add the following JSON to your template.

{
  "type": "Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules",
  "apiVersion": "2023-10-01-preview",
  "name": "string",
  "location": "string",
  "properties": {
    "primaryKey": "string",
    "rights": [ "string" ],
    "secondaryKey": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

Property Values

Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules

Name Description Value
apiVersion The api version '2023-10-01-preview'
location string
name The resource name string

Constraints:
Min length = 1
Max length = 256
Pattern = ^[a-zA-Z0-9!()*-._]+$ (required)
properties SharedAccessAuthorizationRule properties. SharedAccessAuthorizationRuleProperties
tags Resource tags Dictionary of tag names and values. See Tags in templates
type The resource type 'Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules'

SharedAccessAuthorizationRuleProperties

Name Description Value
primaryKey Gets a base64-encoded 256-bit primary key for signing and
validating the SAS token.
string

Constraints:
Sensitive value. Pass in as a secure parameter.
rights Gets or sets the rights associated with the rule. String array containing any of:
'Listen'
'Manage'
'Send' (required)
secondaryKey Gets a base64-encoded 256-bit primary key for signing and
validating the SAS token.
string

Constraints:
Sensitive value. Pass in as a secure parameter.

SharedAccessAuthorizationRuleResourceTags

Name Description Value

Terraform (AzAPI provider) resource definition

The namespaces/notificationHubs/authorizationRules 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

Terraform Samples

A basic example of deploying Authorization Rule associated with a 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    = ["*"]
}

resource "azapi_resource" "authorizationRule" {
  type      = "Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules@2017-04-01"
  parent_id = azapi_resource.notificationHub.id
  name      = var.resource_name
  body = {
    properties = {
      rights = [
        "Listen",
      ]
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

Resource format

To create a Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules resource, add the following Terraform to your template.

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules@2023-10-01-preview"
  name = "string"
  parent_id = "string"
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      primaryKey = "string"
      rights = [
        "string"
      ]
      secondaryKey = "string"
    }
  }
}

Property Values

Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules

Name Description Value
location string
name The resource name string

Constraints:
Min length = 1
Max length = 256
Pattern = ^[a-zA-Z0-9!()*-._]+$ (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: namespaces/notificationHubs
properties SharedAccessAuthorizationRule properties. SharedAccessAuthorizationRuleProperties
tags Resource tags Dictionary of tag names and values.
type The resource type "Microsoft.NotificationHubs/namespaces/notificationHubs/authorizationRules@2023-10-01-preview"

SharedAccessAuthorizationRuleProperties

Name Description Value
primaryKey Gets a base64-encoded 256-bit primary key for signing and
validating the SAS token.
string

Constraints:
Sensitive value. Pass in as a secure parameter.
rights Gets or sets the rights associated with the rule. String array containing any of:
'Listen'
'Manage'
'Send' (required)
secondaryKey Gets a base64-encoded 256-bit primary key for signing and
validating the SAS token.
string

Constraints:
Sensitive value. Pass in as a secure parameter.

SharedAccessAuthorizationRuleResourceTags

Name Description Value