Azure Messaging Authorization Rule

This page shows how to write Terraform and Azure Resource Manager for Messaging Authorization Rule and write them securely.

azurerm_eventhub_authorization_rule (Terraform)

The Authorization Rule in Messaging can be configured in Terraform with the resource name azurerm_eventhub_authorization_rule. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L9
resource "azurerm_eventhub_authorization_rule" "receive" {
  name                = "Listen"
  namespace_name      = var.eventhub_namespace_name
  eventhub_name       = azurerm_eventhub.main.name
  resource_group_name = var.resource_group_name
  listen              = true
event-hub.tf#L33
resource "azurerm_eventhub_authorization_rule" "eh-rule-writer" {
  name                = "writer"
  namespace_name      = azurerm_eventhub_namespace.evh-ns.name
  eventhub_name       = azurerm_eventhub.eh.name
  resource_group_name = azurerm_resource_group.data-integration-rg.name
  listen              = false
main.tf#L25
resource "azurerm_eventhub_authorization_rule" "demo_eh_sender" {
  for_each            = var.event_hubs
  name                = join("-", [each.value.name, "sender"])
  namespace_name      = azurerm_eventhub_namespace.demo_ns.name
  eventhub_name       = each.value.name
  resource_group_name = var.resource_group_name
eventhub-notification.tf#L26
resource "azurerm_eventhub_authorization_rule" "notifications_notifier_send" {
  name                = "send"
  namespace_name      = azurerm_eventhub_namespace.ehns.name
  eventhub_name       = azurerm_eventhub.notifications.name
  resource_group_name = azurerm_resource_group.rg.name
  listen              = false
auth_rules.tf#L2
resource "azurerm_eventhub_authorization_rule" "evhub_rule" {
  name                = var.settings.rule_name
  namespace_name      = var.namespace_name
  eventhub_name       = var.eventhub_name
  resource_group_name = var.resource_group_name
  listen              = var.settings.listen
eventhub.tf#L18
resource "azurerm_eventhub_authorization_rule" "evhar" {
  resource_group_name = azurerm_resource_group.rg.name
  namespace_name      = azurerm_eventhub_namespace.evhns.name
  eventhub_name       = azurerm_eventhub.evh.name
  name                = var.name-evhar
  send                = var.send-evhar
event_hub.tf#L18
resource "azurerm_eventhub_authorization_rule" "evhubiotauthorize" {
  resource_group_name = azurerm_resource_group.rg.name
  namespace_name      = azurerm_eventhub_namespace.evhubiotnmspace.name
  eventhub_name       = azurerm_eventhub.evhubiot.name
  name                = "acctest"
  send                = true
eventhub.tf#L18
resource "azurerm_eventhub_authorization_rule" "evhar" {
  resource_group_name = azurerm_resource_group.rg.name
  namespace_name      = azurerm_eventhub_namespace.evhns.name
  eventhub_name       = azurerm_eventhub.evh.name
  name                = var.name-evhar
  send                = var.send-evhar
eventhub.tf#L18
resource "azurerm_eventhub_authorization_rule" "evhar" {
  resource_group_name = azurerm_resource_group.rg.name
  namespace_name      = azurerm_eventhub_namespace.evhns.name
  eventhub_name       = azurerm_eventhub.evh.name
  name                = var.name-evhar
  send                = var.send-evhar
event_hub.tf#L18
resource "azurerm_eventhub_authorization_rule" "evhubiotauthorize" {
  resource_group_name = azurerm_resource_group.rg.name
  namespace_name      = azurerm_eventhub_namespace.evhubiotnmspace.name
  eventhub_name       = azurerm_eventhub.evhubiot.name
  name                = "acctest"
  send                = true

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Event Hubs authorization Rule within an Event Hub.

Microsoft.EventHub/namespaces/eventhubs/authorizationRules (Azure Resource Manager)

The namespaces/eventhubs/authorizationRules in Microsoft.EventHub can be configured in Azure Resource Manager with the resource name Microsoft.EventHub/namespaces/eventhubs/authorizationRules. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

  • apiVersion required - string
  • name required - string

    The authorization rule name.

  • properties required
      • rights required - array

        The rights associated with the rule.

  • type required - string

Frequently asked questions

What is Azure Messaging Authorization Rule?

Azure Messaging Authorization Rule is a resource for Messaging of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Messaging Authorization Rule?

For Terraform, the eclipse/tractusx, ylasmak/Azure-Function-Event-Hub-Terraform and dmaxim/terrademo source code examples are useful. See the Terraform Example section for further details.