Share via


Microsoft.Relay namespaces/authorizationRules

Bicep resource definition

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

For a list of changed properties in each API version, see change log.

Resource format

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

resource symbolicname 'Microsoft.Relay/namespaces/authorizationRules@2024-01-01' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    rights: [
      'string'
    ]
  }
}

Property Values

Microsoft.Relay/namespaces/authorizationRules

Name Description Value
name The resource name string

Constraints:
Min length = 1 (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 supplied to create or update AuthorizationRule AuthorizationRuleProperties

AuthorizationRuleProperties

Name Description Value
rights The rights associated with the rule. String array containing any of:
'Listen'
'Manage'
'Send' (required)

Usage Examples

Bicep Samples

A basic example of deploying Azure Relay Namespace Authorization Rule.

param resourceName string = 'acctest0001'
param location string = 'westeurope'

resource namespace 'Microsoft.Relay/namespaces@2017-04-01' = {
  name: resourceName
  location: location
  properties: {}
  sku: {
    name: 'Standard'
    tier: 'Standard'
  }
}

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

ARM template resource definition

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

For a list of changed properties in each API version, see change log.

Resource format

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

{
  "type": "Microsoft.Relay/namespaces/authorizationRules",
  "apiVersion": "2024-01-01",
  "name": "string",
  "properties": {
    "rights": [ "string" ]
  }
}

Property Values

Microsoft.Relay/namespaces/authorizationRules

Name Description Value
apiVersion The api version '2024-01-01'
name The resource name string

Constraints:
Min length = 1 (required)
properties Properties supplied to create or update AuthorizationRule AuthorizationRuleProperties
type The resource type 'Microsoft.Relay/namespaces/authorizationRules'

AuthorizationRuleProperties

Name Description Value
rights The rights associated with the rule. String array containing any of:
'Listen'
'Manage'
'Send' (required)

Usage Examples

Terraform (AzAPI provider) resource definition

The namespaces/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.

Resource format

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

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Relay/namespaces/authorizationRules@2024-01-01"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      rights = [
        "string"
      ]
    }
  }
}

Property Values

Microsoft.Relay/namespaces/authorizationRules

Name Description Value
name The resource name string

Constraints:
Min length = 1 (required)
parent_id The ID of the resource that is the parent for this resource. ID for resource of type: namespaces
properties Properties supplied to create or update AuthorizationRule AuthorizationRuleProperties
type The resource type "Microsoft.Relay/namespaces/authorizationRules@2024-01-01"

AuthorizationRuleProperties

Name Description Value
rights The rights associated with the rule. String array containing any of:
'Listen'
'Manage'
'Send' (required)

Usage Examples

Terraform Samples

A basic example of deploying Azure Relay Namespace Authorization Rule.

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.Relay/namespaces@2017-04-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
    }
    sku = {
      name = "Standard"
      tier = "Standard"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}

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