We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.eventhub.getServiceBusNamespace
Explore with Pulumi AI
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
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)
package main
import (
	"github.com/pulumi/pulumi-azure/sdk/v6/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
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() => 
{
    var example = Azure.ServiceBus.GetNamespace.Invoke(new()
    {
        Name = "examplenamespace",
        ResourceGroupName = "example-resources",
    });
    return new Dictionary<string, object?>
    {
        ["location"] = example.Apply(getNamespaceResult => getNamespaceResult.Location),
    };
});
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.GetNamespaceArgs;
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.getNamespace(GetNamespaceArgs.builder()
            .name("examplenamespace")
            .resourceGroupName("example-resources")
            .build());
        ctx.export("location", example.applyValue(getNamespaceResult -> getNamespaceResult.location()));
    }
}
variables:
  example:
    fn::invoke:
      function: azure:servicebus:getNamespace
      arguments:
        name: examplenamespace
        resourceGroupName: example-resources
outputs:
  location: ${example.location}
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 dictionaryThe following arguments are supported:
- Name string
- Specifies the name of the ServiceBus Namespace.
- ResourceGroup stringName 
- Specifies the name of the Resource Group where the ServiceBus Namespace exists.
- Name string
- Specifies the name of the ServiceBus Namespace.
- ResourceGroup stringName 
- Specifies the name of the Resource Group where the ServiceBus Namespace exists.
- name String
- Specifies the name of the ServiceBus Namespace.
- resourceGroup StringName 
- Specifies the name of the Resource Group where the ServiceBus Namespace exists.
- name string
- Specifies the name of the ServiceBus Namespace.
- resourceGroup stringName 
- Specifies the name of the Resource Group where the ServiceBus Namespace exists.
- name str
- Specifies the name of the ServiceBus Namespace.
- resource_group_ strname 
- Specifies the name of the Resource Group where the ServiceBus Namespace exists.
- name String
- Specifies the name of the ServiceBus Namespace.
- resourceGroup StringName 
- 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.
- DefaultPrimary stringConnection String 
- The primary connection string for the authorization
rule RootManageSharedAccessKey.
- DefaultPrimary stringKey 
- The primary access key for the authorization rule RootManageSharedAccessKey.
- DefaultSecondary stringConnection String 
- The secondary connection string for the
authorization rule RootManageSharedAccessKey.
- DefaultSecondary stringKey 
- The secondary access key for the authorization rule RootManageSharedAccessKey.
- Endpoint string
- The URL to access the ServiceBus Namespace.
- 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
- int
- The messaging partitions of the ServiceBus Namespace.
- ResourceGroup stringName 
- Sku string
- The Tier used for the ServiceBus Namespace.
- Dictionary<string, string>
- A mapping of tags assigned to the resource.
- Capacity int
- The capacity of the ServiceBus Namespace.
- DefaultPrimary stringConnection String 
- The primary connection string for the authorization
rule RootManageSharedAccessKey.
- DefaultPrimary stringKey 
- The primary access key for the authorization rule RootManageSharedAccessKey.
- DefaultSecondary stringConnection String 
- The secondary connection string for the
authorization rule RootManageSharedAccessKey.
- DefaultSecondary stringKey 
- The secondary access key for the authorization rule RootManageSharedAccessKey.
- Endpoint string
- The URL to access the ServiceBus Namespace.
- 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
- int
- The messaging partitions of the ServiceBus Namespace.
- ResourceGroup stringName 
- Sku string
- The Tier used for the ServiceBus Namespace.
- map[string]string
- A mapping of tags assigned to the resource.
- capacity Integer
- The capacity of the ServiceBus Namespace.
- defaultPrimary StringConnection String 
- The primary connection string for the authorization
rule RootManageSharedAccessKey.
- defaultPrimary StringKey 
- The primary access key for the authorization rule RootManageSharedAccessKey.
- defaultSecondary StringConnection String 
- The secondary connection string for the
authorization rule RootManageSharedAccessKey.
- defaultSecondary StringKey 
- The secondary access key for the authorization rule RootManageSharedAccessKey.
- endpoint String
- The URL to access the ServiceBus Namespace.
- 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
- Integer
- The messaging partitions of the ServiceBus Namespace.
- resourceGroup StringName 
- sku String
- The Tier used for the ServiceBus Namespace.
- Map<String,String>
- A mapping of tags assigned to the resource.
- capacity number
- The capacity of the ServiceBus Namespace.
- defaultPrimary stringConnection String 
- The primary connection string for the authorization
rule RootManageSharedAccessKey.
- defaultPrimary stringKey 
- The primary access key for the authorization rule RootManageSharedAccessKey.
- defaultSecondary stringConnection String 
- The secondary connection string for the
authorization rule RootManageSharedAccessKey.
- defaultSecondary stringKey 
- The secondary access key for the authorization rule RootManageSharedAccessKey.
- endpoint string
- The URL to access the ServiceBus Namespace.
- 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
- number
- The messaging partitions of the ServiceBus Namespace.
- resourceGroup stringName 
- sku string
- The Tier used for the ServiceBus Namespace.
- {[key: string]: string}
- A mapping of tags assigned to the resource.
- capacity int
- The capacity of the ServiceBus Namespace.
- default_primary_ strconnection_ string 
- The primary connection string for the authorization
rule RootManageSharedAccessKey.
- default_primary_ strkey 
- The primary access key for the authorization rule RootManageSharedAccessKey.
- default_secondary_ strconnection_ string 
- The secondary connection string for the
authorization rule RootManageSharedAccessKey.
- default_secondary_ strkey 
- The secondary access key for the authorization rule RootManageSharedAccessKey.
- endpoint str
- The URL to access the ServiceBus Namespace.
- 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
- int
- The messaging partitions of the ServiceBus Namespace.
- resource_group_ strname 
- sku str
- The Tier used for the ServiceBus Namespace.
- Mapping[str, str]
- A mapping of tags assigned to the resource.
- capacity Number
- The capacity of the ServiceBus Namespace.
- defaultPrimary StringConnection String 
- The primary connection string for the authorization
rule RootManageSharedAccessKey.
- defaultPrimary StringKey 
- The primary access key for the authorization rule RootManageSharedAccessKey.
- defaultSecondary StringConnection String 
- The secondary connection string for the
authorization rule RootManageSharedAccessKey.
- defaultSecondary StringKey 
- The secondary access key for the authorization rule RootManageSharedAccessKey.
- endpoint String
- The URL to access the ServiceBus Namespace.
- 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
- Number
- The messaging partitions of the ServiceBus Namespace.
- resourceGroup StringName 
- sku String
- The Tier used for the ServiceBus Namespace.
- Map<String>
- A mapping of tags assigned to the resource.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the azurermTerraform Provider.