We recommend using Azure Native.
azure.servicebus.getNamespaceAuthorizationRule
Explore with Pulumi AI
Use this data source to access information about an existing ServiceBus Namespace Authorization Rule.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.servicebus.getNamespaceAuthorizationRule({
    name: "examplerule",
    namespaceId: "examplenamespace",
});
export const ruleId = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.servicebus.get_namespace_authorization_rule(name="examplerule",
    namespace_id="examplenamespace")
pulumi.export("ruleId", example.id)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/servicebus"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := servicebus.LookupNamespaceAuthorizationRule(ctx, &servicebus.LookupNamespaceAuthorizationRuleArgs{
			Name:        "examplerule",
			NamespaceId: pulumi.StringRef("examplenamespace"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("ruleId", example.Id)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.ServiceBus.GetNamespaceAuthorizationRule.Invoke(new()
    {
        Name = "examplerule",
        NamespaceId = "examplenamespace",
    });
    return new Dictionary<string, object?>
    {
        ["ruleId"] = example.Apply(getNamespaceAuthorizationRuleResult => getNamespaceAuthorizationRuleResult.Id),
    };
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.servicebus.ServicebusFunctions;
import com.pulumi.azure.servicebus.inputs.GetNamespaceAuthorizationRuleArgs;
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 example = ServicebusFunctions.getNamespaceAuthorizationRule(GetNamespaceAuthorizationRuleArgs.builder()
            .name("examplerule")
            .namespaceId("examplenamespace")
            .build());
        ctx.export("ruleId", example.applyValue(getNamespaceAuthorizationRuleResult -> getNamespaceAuthorizationRuleResult.id()));
    }
}
variables:
  example:
    fn::invoke:
      Function: azure:servicebus:getNamespaceAuthorizationRule
      Arguments:
        name: examplerule
        namespaceId: examplenamespace
outputs:
  ruleId: ${example.id}
Using getNamespaceAuthorizationRule
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 getNamespaceAuthorizationRule(args: GetNamespaceAuthorizationRuleArgs, opts?: InvokeOptions): Promise<GetNamespaceAuthorizationRuleResult>
function getNamespaceAuthorizationRuleOutput(args: GetNamespaceAuthorizationRuleOutputArgs, opts?: InvokeOptions): Output<GetNamespaceAuthorizationRuleResult>def get_namespace_authorization_rule(name: Optional[str] = None,
                                     namespace_id: Optional[str] = None,
                                     namespace_name: Optional[str] = None,
                                     resource_group_name: Optional[str] = None,
                                     opts: Optional[InvokeOptions] = None) -> GetNamespaceAuthorizationRuleResult
def get_namespace_authorization_rule_output(name: Optional[pulumi.Input[str]] = None,
                                     namespace_id: Optional[pulumi.Input[str]] = None,
                                     namespace_name: Optional[pulumi.Input[str]] = None,
                                     resource_group_name: Optional[pulumi.Input[str]] = None,
                                     opts: Optional[InvokeOptions] = None) -> Output[GetNamespaceAuthorizationRuleResult]func LookupNamespaceAuthorizationRule(ctx *Context, args *LookupNamespaceAuthorizationRuleArgs, opts ...InvokeOption) (*LookupNamespaceAuthorizationRuleResult, error)
func LookupNamespaceAuthorizationRuleOutput(ctx *Context, args *LookupNamespaceAuthorizationRuleOutputArgs, opts ...InvokeOption) LookupNamespaceAuthorizationRuleResultOutput> Note: This function is named LookupNamespaceAuthorizationRule in the Go SDK.
public static class GetNamespaceAuthorizationRule 
{
    public static Task<GetNamespaceAuthorizationRuleResult> InvokeAsync(GetNamespaceAuthorizationRuleArgs args, InvokeOptions? opts = null)
    public static Output<GetNamespaceAuthorizationRuleResult> Invoke(GetNamespaceAuthorizationRuleInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNamespaceAuthorizationRuleResult> getNamespaceAuthorizationRule(GetNamespaceAuthorizationRuleArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: azure:servicebus/getNamespaceAuthorizationRule:getNamespaceAuthorizationRule
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
 - Specifies the name of the ServiceBus Namespace Authorization Rule.
 - Namespace
Id string - Specifies the ID of the ServiceBus Namespace where the Service Bus Namespace Authorization Rule exists.
 - Namespace
Name string - Specifies the name of the ServiceBus Namespace.
 - Resource
Group stringName  Specifies the name of the Resource Group where the ServiceBus Namespace exists.
Note:
namespace_nameandresource_group_namehas been deprecated and will be removed in version 4.0 of the provider in favour ofnamespace_id.
- Name string
 - Specifies the name of the ServiceBus Namespace Authorization Rule.
 - Namespace
Id string - Specifies the ID of the ServiceBus Namespace where the Service Bus Namespace Authorization Rule exists.
 - Namespace
Name string - Specifies the name of the ServiceBus Namespace.
 - Resource
Group stringName  Specifies the name of the Resource Group where the ServiceBus Namespace exists.
Note:
namespace_nameandresource_group_namehas been deprecated and will be removed in version 4.0 of the provider in favour ofnamespace_id.
- name String
 - Specifies the name of the ServiceBus Namespace Authorization Rule.
 - namespace
Id String - Specifies the ID of the ServiceBus Namespace where the Service Bus Namespace Authorization Rule exists.
 - namespace
Name String - Specifies the name of the ServiceBus Namespace.
 - resource
Group StringName  Specifies the name of the Resource Group where the ServiceBus Namespace exists.
Note:
namespace_nameandresource_group_namehas been deprecated and will be removed in version 4.0 of the provider in favour ofnamespace_id.
- name string
 - Specifies the name of the ServiceBus Namespace Authorization Rule.
 - namespace
Id string - Specifies the ID of the ServiceBus Namespace where the Service Bus Namespace Authorization Rule exists.
 - namespace
Name string - Specifies the name of the ServiceBus Namespace.
 - resource
Group stringName  Specifies the name of the Resource Group where the ServiceBus Namespace exists.
Note:
namespace_nameandresource_group_namehas been deprecated and will be removed in version 4.0 of the provider in favour ofnamespace_id.
- name str
 - Specifies the name of the ServiceBus Namespace Authorization Rule.
 - namespace_
id str - Specifies the ID of the ServiceBus Namespace where the Service Bus Namespace Authorization Rule exists.
 - namespace_
name str - Specifies the name of the ServiceBus Namespace.
 - resource_
group_ strname  Specifies the name of the Resource Group where the ServiceBus Namespace exists.
Note:
namespace_nameandresource_group_namehas been deprecated and will be removed in version 4.0 of the provider in favour ofnamespace_id.
- name String
 - Specifies the name of the ServiceBus Namespace Authorization Rule.
 - namespace
Id String - Specifies the ID of the ServiceBus Namespace where the Service Bus Namespace Authorization Rule exists.
 - namespace
Name String - Specifies the name of the ServiceBus Namespace.
 - resource
Group StringName  Specifies the name of the Resource Group where the ServiceBus Namespace exists.
Note:
namespace_nameandresource_group_namehas been deprecated and will be removed in version 4.0 of the provider in favour ofnamespace_id.
getNamespaceAuthorizationRule Result
The following output properties are available:
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Name string
 - Primary
Connection stringString  - The primary connection string for the authorization rule.
 - Primary
Connection stringString Alias  - The alias Primary Connection String for the ServiceBus Namespace, if the namespace is Geo DR paired.
 - Primary
Key string - The primary access key for the authorization rule.
 - Secondary
Connection stringString  - The secondary connection string for the authorization rule.
 - Secondary
Connection stringString Alias  - The alias Secondary Connection String for the ServiceBus Namespace
 - Secondary
Key string - The secondary access key for the authorization rule.
 - Namespace
Id string - Namespace
Name string - Resource
Group stringName  
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Name string
 - Primary
Connection stringString  - The primary connection string for the authorization rule.
 - Primary
Connection stringString Alias  - The alias Primary Connection String for the ServiceBus Namespace, if the namespace is Geo DR paired.
 - Primary
Key string - The primary access key for the authorization rule.
 - Secondary
Connection stringString  - The secondary connection string for the authorization rule.
 - Secondary
Connection stringString Alias  - The alias Secondary Connection String for the ServiceBus Namespace
 - Secondary
Key string - The secondary access key for the authorization rule.
 - Namespace
Id string - Namespace
Name string - Resource
Group stringName  
- id String
 - The provider-assigned unique ID for this managed resource.
 - name String
 - primary
Connection StringString  - The primary connection string for the authorization rule.
 - primary
Connection StringString Alias  - The alias Primary Connection String for the ServiceBus Namespace, if the namespace is Geo DR paired.
 - primary
Key String - The primary access key for the authorization rule.
 - secondary
Connection StringString  - The secondary connection string for the authorization rule.
 - secondary
Connection StringString Alias  - The alias Secondary Connection String for the ServiceBus Namespace
 - secondary
Key String - The secondary access key for the authorization rule.
 - namespace
Id String - namespace
Name String - resource
Group StringName  
- id string
 - The provider-assigned unique ID for this managed resource.
 - name string
 - primary
Connection stringString  - The primary connection string for the authorization rule.
 - primary
Connection stringString Alias  - The alias Primary Connection String for the ServiceBus Namespace, if the namespace is Geo DR paired.
 - primary
Key string - The primary access key for the authorization rule.
 - secondary
Connection stringString  - The secondary connection string for the authorization rule.
 - secondary
Connection stringString Alias  - The alias Secondary Connection String for the ServiceBus Namespace
 - secondary
Key string - The secondary access key for the authorization rule.
 - namespace
Id string - namespace
Name string - resource
Group stringName  
- id str
 - The provider-assigned unique ID for this managed resource.
 - name str
 - primary_
connection_ strstring  - The primary connection string for the authorization rule.
 - primary_
connection_ strstring_ alias  - The alias Primary Connection String for the ServiceBus Namespace, if the namespace is Geo DR paired.
 - primary_
key str - The primary access key for the authorization rule.
 - secondary_
connection_ strstring  - The secondary connection string for the authorization rule.
 - secondary_
connection_ strstring_ alias  - The alias Secondary Connection String for the ServiceBus Namespace
 - secondary_
key str - The secondary access key for the authorization rule.
 - namespace_
id str - namespace_
name str - resource_
group_ strname  
- id String
 - The provider-assigned unique ID for this managed resource.
 - name String
 - primary
Connection StringString  - The primary connection string for the authorization rule.
 - primary
Connection StringString Alias  - The alias Primary Connection String for the ServiceBus Namespace, if the namespace is Geo DR paired.
 - primary
Key String - The primary access key for the authorization rule.
 - secondary
Connection StringString  - The secondary connection string for the authorization rule.
 - secondary
Connection StringString Alias  - The alias Secondary Connection String for the ServiceBus Namespace
 - secondary
Key String - The secondary access key for the authorization rule.
 - namespace
Id String - namespace
Name String - resource
Group StringName  
Package Details
- Repository
 - Azure Classic pulumi/pulumi-azure
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
azurermTerraform Provider.