We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.eventhub.getAuthorizationRule
Explore with Pulumi AI
Use this data source to access information about an existing Event Hubs Authorization Rule within an Event Hub.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const test = azure.eventhub.getAuthorizationRule({
    name: "test",
    namespaceName: testAzurermEventhubNamespace.name,
    eventhubName: testAzurermEventhub.name,
    resourceGroupName: testAzurermResourceGroup.name,
});
import pulumi
import pulumi_azure as azure
test = azure.eventhub.get_authorization_rule(name="test",
    namespace_name=test_azurerm_eventhub_namespace["name"],
    eventhub_name=test_azurerm_eventhub["name"],
    resource_group_name=test_azurerm_resource_group["name"])
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/eventhub"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := eventhub.LookupAuthorizationRule(ctx, &eventhub.LookupAuthorizationRuleArgs{
			Name:              "test",
			NamespaceName:     testAzurermEventhubNamespace.Name,
			EventhubName:      testAzurermEventhub.Name,
			ResourceGroupName: testAzurermResourceGroup.Name,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var test = Azure.EventHub.GetAuthorizationRule.Invoke(new()
    {
        Name = "test",
        NamespaceName = testAzurermEventhubNamespace.Name,
        EventhubName = testAzurermEventhub.Name,
        ResourceGroupName = testAzurermResourceGroup.Name,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.eventhub.EventhubFunctions;
import com.pulumi.azure.eventhub.inputs.GetAuthorizationRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        final var test = EventhubFunctions.getAuthorizationRule(GetAuthorizationRuleArgs.builder()
            .name("test")
            .namespaceName(testAzurermEventhubNamespace.name())
            .eventhubName(testAzurermEventhub.name())
            .resourceGroupName(testAzurermResourceGroup.name())
            .build());
    }
}
variables:
  test:
    fn::invoke:
      function: azure:eventhub:getAuthorizationRule
      arguments:
        name: test
        namespaceName: ${testAzurermEventhubNamespace.name}
        eventhubName: ${testAzurermEventhub.name}
        resourceGroupName: ${testAzurermResourceGroup.name}
Using getAuthorizationRule
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getAuthorizationRule(args: GetAuthorizationRuleArgs, opts?: InvokeOptions): Promise<GetAuthorizationRuleResult>
function getAuthorizationRuleOutput(args: GetAuthorizationRuleOutputArgs, opts?: InvokeOptions): Output<GetAuthorizationRuleResult>def get_authorization_rule(eventhub_name: Optional[str] = None,
                           listen: Optional[bool] = None,
                           manage: Optional[bool] = None,
                           name: Optional[str] = None,
                           namespace_name: Optional[str] = None,
                           resource_group_name: Optional[str] = None,
                           send: Optional[bool] = None,
                           opts: Optional[InvokeOptions] = None) -> GetAuthorizationRuleResult
def get_authorization_rule_output(eventhub_name: Optional[pulumi.Input[str]] = None,
                           listen: Optional[pulumi.Input[bool]] = None,
                           manage: Optional[pulumi.Input[bool]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           namespace_name: Optional[pulumi.Input[str]] = None,
                           resource_group_name: Optional[pulumi.Input[str]] = None,
                           send: Optional[pulumi.Input[bool]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetAuthorizationRuleResult]func LookupAuthorizationRule(ctx *Context, args *LookupAuthorizationRuleArgs, opts ...InvokeOption) (*LookupAuthorizationRuleResult, error)
func LookupAuthorizationRuleOutput(ctx *Context, args *LookupAuthorizationRuleOutputArgs, opts ...InvokeOption) LookupAuthorizationRuleResultOutput> Note: This function is named LookupAuthorizationRule in the Go SDK.
public static class GetAuthorizationRule 
{
    public static Task<GetAuthorizationRuleResult> InvokeAsync(GetAuthorizationRuleArgs args, InvokeOptions? opts = null)
    public static Output<GetAuthorizationRuleResult> Invoke(GetAuthorizationRuleInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetAuthorizationRuleResult> getAuthorizationRule(GetAuthorizationRuleArgs args, InvokeOptions options)
public static Output<GetAuthorizationRuleResult> getAuthorizationRule(GetAuthorizationRuleArgs args, InvokeOptions options)
fn::invoke:
  function: azure:eventhub/getAuthorizationRule:getAuthorizationRule
  arguments:
    # arguments dictionaryThe following arguments are supported:
- EventhubName string
- Specifies the name of the EventHub.
- Name string
- Specifies the name of the EventHub Authorization Rule resource. be created.
- NamespaceName string
- Specifies the name of the grandparent EventHub Namespace.
- ResourceGroup stringName 
- The name of the resource group in which the EventHub Authorization Rule's grandparent Namespace exists.
- Listen bool
- Manage bool
- Send bool
- EventhubName string
- Specifies the name of the EventHub.
- Name string
- Specifies the name of the EventHub Authorization Rule resource. be created.
- NamespaceName string
- Specifies the name of the grandparent EventHub Namespace.
- ResourceGroup stringName 
- The name of the resource group in which the EventHub Authorization Rule's grandparent Namespace exists.
- Listen bool
- Manage bool
- Send bool
- eventhubName String
- Specifies the name of the EventHub.
- name String
- Specifies the name of the EventHub Authorization Rule resource. be created.
- namespaceName String
- Specifies the name of the grandparent EventHub Namespace.
- resourceGroup StringName 
- The name of the resource group in which the EventHub Authorization Rule's grandparent Namespace exists.
- listen Boolean
- manage Boolean
- send Boolean
- eventhubName string
- Specifies the name of the EventHub.
- name string
- Specifies the name of the EventHub Authorization Rule resource. be created.
- namespaceName string
- Specifies the name of the grandparent EventHub Namespace.
- resourceGroup stringName 
- The name of the resource group in which the EventHub Authorization Rule's grandparent Namespace exists.
- listen boolean
- manage boolean
- send boolean
- eventhub_name str
- Specifies the name of the EventHub.
- name str
- Specifies the name of the EventHub Authorization Rule resource. be created.
- namespace_name str
- Specifies the name of the grandparent EventHub Namespace.
- resource_group_ strname 
- The name of the resource group in which the EventHub Authorization Rule's grandparent Namespace exists.
- listen bool
- manage bool
- send bool
- eventhubName String
- Specifies the name of the EventHub.
- name String
- Specifies the name of the EventHub Authorization Rule resource. be created.
- namespaceName String
- Specifies the name of the grandparent EventHub Namespace.
- resourceGroup StringName 
- The name of the resource group in which the EventHub Authorization Rule's grandparent Namespace exists.
- listen Boolean
- manage Boolean
- send Boolean
getAuthorizationRule Result
The following output properties are available:
- EventhubName string
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- NamespaceName string
- PrimaryConnection stringString 
- The Primary Connection String for the Event Hubs Authorization Rule.
- PrimaryConnection stringString Alias 
- The alias of the Primary Connection String for the Event Hubs Authorization Rule.
- PrimaryKey string
- The Primary Key for the Event Hubs Authorization Rule.
- ResourceGroup stringName 
- SecondaryConnection stringString 
- The Secondary Connection String for the Event Hubs Authorization Rule.
- SecondaryConnection stringString Alias 
- The alias of the Secondary Connection String for the Event Hubs Authorization Rule.
- SecondaryKey string
- The Secondary Key for the Event Hubs Authorization Rule.
- Listen bool
- Manage bool
- Send bool
- EventhubName string
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- NamespaceName string
- PrimaryConnection stringString 
- The Primary Connection String for the Event Hubs Authorization Rule.
- PrimaryConnection stringString Alias 
- The alias of the Primary Connection String for the Event Hubs Authorization Rule.
- PrimaryKey string
- The Primary Key for the Event Hubs Authorization Rule.
- ResourceGroup stringName 
- SecondaryConnection stringString 
- The Secondary Connection String for the Event Hubs Authorization Rule.
- SecondaryConnection stringString Alias 
- The alias of the Secondary Connection String for the Event Hubs Authorization Rule.
- SecondaryKey string
- The Secondary Key for the Event Hubs Authorization Rule.
- Listen bool
- Manage bool
- Send bool
- eventhubName String
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- namespaceName String
- primaryConnection StringString 
- The Primary Connection String for the Event Hubs Authorization Rule.
- primaryConnection StringString Alias 
- The alias of the Primary Connection String for the Event Hubs Authorization Rule.
- primaryKey String
- The Primary Key for the Event Hubs Authorization Rule.
- resourceGroup StringName 
- secondaryConnection StringString 
- The Secondary Connection String for the Event Hubs Authorization Rule.
- secondaryConnection StringString Alias 
- The alias of the Secondary Connection String for the Event Hubs Authorization Rule.
- secondaryKey String
- The Secondary Key for the Event Hubs Authorization Rule.
- listen Boolean
- manage Boolean
- send Boolean
- eventhubName string
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- namespaceName string
- primaryConnection stringString 
- The Primary Connection String for the Event Hubs Authorization Rule.
- primaryConnection stringString Alias 
- The alias of the Primary Connection String for the Event Hubs Authorization Rule.
- primaryKey string
- The Primary Key for the Event Hubs Authorization Rule.
- resourceGroup stringName 
- secondaryConnection stringString 
- The Secondary Connection String for the Event Hubs Authorization Rule.
- secondaryConnection stringString Alias 
- The alias of the Secondary Connection String for the Event Hubs Authorization Rule.
- secondaryKey string
- The Secondary Key for the Event Hubs Authorization Rule.
- listen boolean
- manage boolean
- send boolean
- eventhub_name str
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- namespace_name str
- primary_connection_ strstring 
- The Primary Connection String for the Event Hubs Authorization Rule.
- primary_connection_ strstring_ alias 
- The alias of the Primary Connection String for the Event Hubs Authorization Rule.
- primary_key str
- The Primary Key for the Event Hubs Authorization Rule.
- resource_group_ strname 
- secondary_connection_ strstring 
- The Secondary Connection String for the Event Hubs Authorization Rule.
- secondary_connection_ strstring_ alias 
- The alias of the Secondary Connection String for the Event Hubs Authorization Rule.
- secondary_key str
- The Secondary Key for the Event Hubs Authorization Rule.
- listen bool
- manage bool
- send bool
- eventhubName String
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- namespaceName String
- primaryConnection StringString 
- The Primary Connection String for the Event Hubs Authorization Rule.
- primaryConnection StringString Alias 
- The alias of the Primary Connection String for the Event Hubs Authorization Rule.
- primaryKey String
- The Primary Key for the Event Hubs Authorization Rule.
- resourceGroup StringName 
- secondaryConnection StringString 
- The Secondary Connection String for the Event Hubs Authorization Rule.
- secondaryConnection StringString Alias 
- The alias of the Secondary Connection String for the Event Hubs Authorization Rule.
- secondaryKey String
- The Secondary Key for the Event Hubs Authorization Rule.
- listen Boolean
- manage Boolean
- send Boolean
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.