1. Packages
  2. Azure Classic
  3. API Docs
  4. eventhub
  5. getServiceBusNamespace

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
    Deprecated: azure.eventhub.getServiceBusNamespace has been deprecated in favor of azure.servicebus.getNamespace

    Use this data source to access information about an existing ServiceBus Namespace.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var example = Output.Create(Azure.ServiceBus.GetNamespace.InvokeAsync(new Azure.ServiceBus.GetNamespaceArgs
            {
                Name = "examplenamespace",
                ResourceGroupName = "example-resources",
            }));
            this.Location = example.Apply(example => example.Location);
        }
    
        [Output("location")]
        public Output<string> Location { get; set; }
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/servicebus"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := servicebus.LookupNamespace(ctx, &servicebus.LookupNamespaceArgs{
    			Name:              "examplenamespace",
    			ResourceGroupName: "example-resources",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("location", example.Location)
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.servicebus.getNamespace({
        name: "examplenamespace",
        resourceGroupName: "example-resources",
    });
    export const location = example.then(example => example.location);
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.servicebus.get_namespace(name="examplenamespace",
        resource_group_name="example-resources")
    pulumi.export("location", example.location)
    

    Example coming soon!

    Using getServiceBusNamespace

    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 getServiceBusNamespace(args: GetServiceBusNamespaceArgs, opts?: InvokeOptions): Promise<GetServiceBusNamespaceResult>
    function getServiceBusNamespaceOutput(args: GetServiceBusNamespaceOutputArgs, opts?: InvokeOptions): Output<GetServiceBusNamespaceResult>
    def get_service_bus_namespace(name: Optional[str] = None,
                                  resource_group_name: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetServiceBusNamespaceResult
    def get_service_bus_namespace_output(name: Optional[pulumi.Input[str]] = None,
                                  resource_group_name: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetServiceBusNamespaceResult]
    func GetServiceBusNamespace(ctx *Context, args *GetServiceBusNamespaceArgs, opts ...InvokeOption) (*GetServiceBusNamespaceResult, error)
    func GetServiceBusNamespaceOutput(ctx *Context, args *GetServiceBusNamespaceOutputArgs, opts ...InvokeOption) GetServiceBusNamespaceResultOutput

    > Note: This function is named GetServiceBusNamespace in the Go SDK.

    public static class GetServiceBusNamespace 
    {
        public static Task<GetServiceBusNamespaceResult> InvokeAsync(GetServiceBusNamespaceArgs args, InvokeOptions? opts = null)
        public static Output<GetServiceBusNamespaceResult> Invoke(GetServiceBusNamespaceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServiceBusNamespaceResult> getServiceBusNamespace(GetServiceBusNamespaceArgs args, InvokeOptions options)
    public static Output<GetServiceBusNamespaceResult> getServiceBusNamespace(GetServiceBusNamespaceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: azure:eventhub/getServiceBusNamespace:getServiceBusNamespace
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Specifies the name of the ServiceBus Namespace.
    ResourceGroupName string
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.
    Name string
    Specifies the name of the ServiceBus Namespace.
    ResourceGroupName string
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.
    name String
    Specifies the name of the ServiceBus Namespace.
    resourceGroupName String
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.
    name string
    Specifies the name of the ServiceBus Namespace.
    resourceGroupName string
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.
    name str
    Specifies the name of the ServiceBus Namespace.
    resource_group_name str
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.
    name String
    Specifies the name of the ServiceBus Namespace.
    resourceGroupName String
    Specifies the name of the Resource Group where the ServiceBus Namespace exists.

    getServiceBusNamespace Result

    The following output properties are available:

    Capacity int
    The capacity of the ServiceBus Namespace.
    DefaultPrimaryConnectionString string
    The primary connection string for the authorization rule RootManageSharedAccessKey.
    DefaultPrimaryKey string
    The primary access key for the authorization rule RootManageSharedAccessKey.
    DefaultSecondaryConnectionString string
    The secondary connection string for the authorization rule RootManageSharedAccessKey.
    DefaultSecondaryKey string
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The location of the Resource Group in which the ServiceBus Namespace exists.
    Name string
    ResourceGroupName string
    Sku string
    The Tier used for the ServiceBus Namespace.
    Tags Dictionary<string, string>
    A mapping of tags assigned to the resource.
    ZoneRedundant bool
    Whether or not this ServiceBus Namespace is zone redundant.
    Capacity int
    The capacity of the ServiceBus Namespace.
    DefaultPrimaryConnectionString string
    The primary connection string for the authorization rule RootManageSharedAccessKey.
    DefaultPrimaryKey string
    The primary access key for the authorization rule RootManageSharedAccessKey.
    DefaultSecondaryConnectionString string
    The secondary connection string for the authorization rule RootManageSharedAccessKey.
    DefaultSecondaryKey string
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    The location of the Resource Group in which the ServiceBus Namespace exists.
    Name string
    ResourceGroupName string
    Sku string
    The Tier used for the ServiceBus Namespace.
    Tags map[string]string
    A mapping of tags assigned to the resource.
    ZoneRedundant bool
    Whether or not this ServiceBus Namespace is zone redundant.
    capacity Integer
    The capacity of the ServiceBus Namespace.
    defaultPrimaryConnectionString String
    The primary connection string for the authorization rule RootManageSharedAccessKey.
    defaultPrimaryKey String
    The primary access key for the authorization rule RootManageSharedAccessKey.
    defaultSecondaryConnectionString String
    The secondary connection string for the authorization rule RootManageSharedAccessKey.
    defaultSecondaryKey String
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The location of the Resource Group in which the ServiceBus Namespace exists.
    name String
    resourceGroupName String
    sku String
    The Tier used for the ServiceBus Namespace.
    tags Map<String,String>
    A mapping of tags assigned to the resource.
    zoneRedundant Boolean
    Whether or not this ServiceBus Namespace is zone redundant.
    capacity number
    The capacity of the ServiceBus Namespace.
    defaultPrimaryConnectionString string
    The primary connection string for the authorization rule RootManageSharedAccessKey.
    defaultPrimaryKey string
    The primary access key for the authorization rule RootManageSharedAccessKey.
    defaultSecondaryConnectionString string
    The secondary connection string for the authorization rule RootManageSharedAccessKey.
    defaultSecondaryKey string
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    The location of the Resource Group in which the ServiceBus Namespace exists.
    name string
    resourceGroupName string
    sku string
    The Tier used for the ServiceBus Namespace.
    tags {[key: string]: string}
    A mapping of tags assigned to the resource.
    zoneRedundant boolean
    Whether or not this ServiceBus Namespace is zone redundant.
    capacity int
    The capacity of the ServiceBus Namespace.
    default_primary_connection_string str
    The primary connection string for the authorization rule RootManageSharedAccessKey.
    default_primary_key str
    The primary access key for the authorization rule RootManageSharedAccessKey.
    default_secondary_connection_string str
    The secondary connection string for the authorization rule RootManageSharedAccessKey.
    default_secondary_key str
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    The location of the Resource Group in which the ServiceBus Namespace exists.
    name str
    resource_group_name str
    sku str
    The Tier used for the ServiceBus Namespace.
    tags Mapping[str, str]
    A mapping of tags assigned to the resource.
    zone_redundant bool
    Whether or not this ServiceBus Namespace is zone redundant.
    capacity Number
    The capacity of the ServiceBus Namespace.
    defaultPrimaryConnectionString String
    The primary connection string for the authorization rule RootManageSharedAccessKey.
    defaultPrimaryKey String
    The primary access key for the authorization rule RootManageSharedAccessKey.
    defaultSecondaryConnectionString String
    The secondary connection string for the authorization rule RootManageSharedAccessKey.
    defaultSecondaryKey String
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    The location of the Resource Group in which the ServiceBus Namespace exists.
    name String
    resourceGroupName String
    sku String
    The Tier used for the ServiceBus Namespace.
    tags Map<String>
    A mapping of tags assigned to the resource.
    zoneRedundant Boolean
    Whether or not this ServiceBus Namespace is zone redundant.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.