1. Packages
  2. Azure Classic
  3. API Docs
  4. servicebus
  5. NamespaceDisasterRecoveryConfig

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

    Manages a Disaster Recovery Config for a Service Bus Namespace.

    NOTE: Disaster Recovery Config is a Premium Sku only capability.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
            {
                Location = "West Europe",
            });
            var primary = new Azure.ServiceBus.Namespace("primary", new Azure.ServiceBus.NamespaceArgs
            {
                Location = exampleResourceGroup.Location,
                ResourceGroupName = exampleResourceGroup.Name,
                Sku = "Premium",
                Capacity = 1,
            });
            var secondary = new Azure.ServiceBus.Namespace("secondary", new Azure.ServiceBus.NamespaceArgs
            {
                Location = "West US",
                ResourceGroupName = exampleResourceGroup.Name,
                Sku = "Premium",
                Capacity = 1,
            });
            var exampleNamespaceDisasterRecoveryConfig = new Azure.ServiceBus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", new Azure.ServiceBus.NamespaceDisasterRecoveryConfigArgs
            {
                PrimaryNamespaceId = primary.Id,
                PartnerNamespaceId = secondary.Id,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"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 {
    		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		primary, err := servicebus.NewNamespace(ctx, "primary", &servicebus.NamespaceArgs{
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			Sku:               pulumi.String("Premium"),
    			Capacity:          pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		secondary, err := servicebus.NewNamespace(ctx, "secondary", &servicebus.NamespaceArgs{
    			Location:          pulumi.String("West US"),
    			ResourceGroupName: exampleResourceGroup.Name,
    			Sku:               pulumi.String("Premium"),
    			Capacity:          pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = servicebus.NewNamespaceDisasterRecoveryConfig(ctx, "exampleNamespaceDisasterRecoveryConfig", &servicebus.NamespaceDisasterRecoveryConfigArgs{
    			PrimaryNamespaceId: primary.ID(),
    			PartnerNamespaceId: secondary.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
    const primary = new azure.servicebus.Namespace("primary", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        sku: "Premium",
        capacity: "1",
    });
    const secondary = new azure.servicebus.Namespace("secondary", {
        location: "West US",
        resourceGroupName: exampleResourceGroup.name,
        sku: "Premium",
        capacity: "1",
    });
    const exampleNamespaceDisasterRecoveryConfig = new azure.servicebus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig", {
        primaryNamespaceId: primary.id,
        partnerNamespaceId: secondary.id,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
    primary = azure.servicebus.Namespace("primary",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        sku="Premium",
        capacity=1)
    secondary = azure.servicebus.Namespace("secondary",
        location="West US",
        resource_group_name=example_resource_group.name,
        sku="Premium",
        capacity=1)
    example_namespace_disaster_recovery_config = azure.servicebus.NamespaceDisasterRecoveryConfig("exampleNamespaceDisasterRecoveryConfig",
        primary_namespace_id=primary.id,
        partner_namespace_id=secondary.id)
    

    Example coming soon!

    Create NamespaceDisasterRecoveryConfig Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new NamespaceDisasterRecoveryConfig(name: string, args: NamespaceDisasterRecoveryConfigArgs, opts?: CustomResourceOptions);
    @overload
    def NamespaceDisasterRecoveryConfig(resource_name: str,
                                        args: NamespaceDisasterRecoveryConfigArgs,
                                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def NamespaceDisasterRecoveryConfig(resource_name: str,
                                        opts: Optional[ResourceOptions] = None,
                                        partner_namespace_id: Optional[str] = None,
                                        primary_namespace_id: Optional[str] = None,
                                        name: Optional[str] = None)
    func NewNamespaceDisasterRecoveryConfig(ctx *Context, name string, args NamespaceDisasterRecoveryConfigArgs, opts ...ResourceOption) (*NamespaceDisasterRecoveryConfig, error)
    public NamespaceDisasterRecoveryConfig(string name, NamespaceDisasterRecoveryConfigArgs args, CustomResourceOptions? opts = null)
    public NamespaceDisasterRecoveryConfig(String name, NamespaceDisasterRecoveryConfigArgs args)
    public NamespaceDisasterRecoveryConfig(String name, NamespaceDisasterRecoveryConfigArgs args, CustomResourceOptions options)
    
    type: azure:servicebus:NamespaceDisasterRecoveryConfig
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args NamespaceDisasterRecoveryConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args NamespaceDisasterRecoveryConfigArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args NamespaceDisasterRecoveryConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NamespaceDisasterRecoveryConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NamespaceDisasterRecoveryConfigArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var namespaceDisasterRecoveryConfigResource = new Azure.ServiceBus.NamespaceDisasterRecoveryConfig("namespaceDisasterRecoveryConfigResource", new()
    {
        PartnerNamespaceId = "string",
        PrimaryNamespaceId = "string",
        Name = "string",
    });
    
    example, err := servicebus.NewNamespaceDisasterRecoveryConfig(ctx, "namespaceDisasterRecoveryConfigResource", &servicebus.NamespaceDisasterRecoveryConfigArgs{
    	PartnerNamespaceId: pulumi.String("string"),
    	PrimaryNamespaceId: pulumi.String("string"),
    	Name:               pulumi.String("string"),
    })
    
    var namespaceDisasterRecoveryConfigResource = new NamespaceDisasterRecoveryConfig("namespaceDisasterRecoveryConfigResource", NamespaceDisasterRecoveryConfigArgs.builder()
        .partnerNamespaceId("string")
        .primaryNamespaceId("string")
        .name("string")
        .build());
    
    namespace_disaster_recovery_config_resource = azure.servicebus.NamespaceDisasterRecoveryConfig("namespaceDisasterRecoveryConfigResource",
        partner_namespace_id="string",
        primary_namespace_id="string",
        name="string")
    
    const namespaceDisasterRecoveryConfigResource = new azure.servicebus.NamespaceDisasterRecoveryConfig("namespaceDisasterRecoveryConfigResource", {
        partnerNamespaceId: "string",
        primaryNamespaceId: "string",
        name: "string",
    });
    
    type: azure:servicebus:NamespaceDisasterRecoveryConfig
    properties:
        name: string
        partnerNamespaceId: string
        primaryNamespaceId: string
    

    NamespaceDisasterRecoveryConfig Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The NamespaceDisasterRecoveryConfig resource accepts the following input properties:

    PartnerNamespaceId string
    The ID of the Service Bus Namespace to replicate to.
    PrimaryNamespaceId string
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    Name string
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    PartnerNamespaceId string
    The ID of the Service Bus Namespace to replicate to.
    PrimaryNamespaceId string
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    Name string
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    partnerNamespaceId String
    The ID of the Service Bus Namespace to replicate to.
    primaryNamespaceId String
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    partnerNamespaceId string
    The ID of the Service Bus Namespace to replicate to.
    primaryNamespaceId string
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    name string
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    partner_namespace_id str
    The ID of the Service Bus Namespace to replicate to.
    primary_namespace_id str
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    name str
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    partnerNamespaceId String
    The ID of the Service Bus Namespace to replicate to.
    primaryNamespaceId String
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    name String
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NamespaceDisasterRecoveryConfig resource produces the following output properties:

    DefaultPrimaryKey string
    The primary access key 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.
    PrimaryConnectionStringAlias string
    The alias Primary Connection String for the ServiceBus Namespace.
    SecondaryConnectionStringAlias string
    The alias Secondary Connection String for the ServiceBus Namespace
    DefaultPrimaryKey string
    The primary access key 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.
    PrimaryConnectionStringAlias string
    The alias Primary Connection String for the ServiceBus Namespace.
    SecondaryConnectionStringAlias string
    The alias Secondary Connection String for the ServiceBus Namespace
    defaultPrimaryKey String
    The primary access key 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.
    primaryConnectionStringAlias String
    The alias Primary Connection String for the ServiceBus Namespace.
    secondaryConnectionStringAlias String
    The alias Secondary Connection String for the ServiceBus Namespace
    defaultPrimaryKey string
    The primary access key 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.
    primaryConnectionStringAlias string
    The alias Primary Connection String for the ServiceBus Namespace.
    secondaryConnectionStringAlias string
    The alias Secondary Connection String for the ServiceBus Namespace
    default_primary_key str
    The primary access key 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.
    primary_connection_string_alias str
    The alias Primary Connection String for the ServiceBus Namespace.
    secondary_connection_string_alias str
    The alias Secondary Connection String for the ServiceBus Namespace
    defaultPrimaryKey String
    The primary access key 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.
    primaryConnectionStringAlias String
    The alias Primary Connection String for the ServiceBus Namespace.
    secondaryConnectionStringAlias String
    The alias Secondary Connection String for the ServiceBus Namespace

    Look up Existing NamespaceDisasterRecoveryConfig Resource

    Get an existing NamespaceDisasterRecoveryConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: NamespaceDisasterRecoveryConfigState, opts?: CustomResourceOptions): NamespaceDisasterRecoveryConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            default_primary_key: Optional[str] = None,
            default_secondary_key: Optional[str] = None,
            name: Optional[str] = None,
            partner_namespace_id: Optional[str] = None,
            primary_connection_string_alias: Optional[str] = None,
            primary_namespace_id: Optional[str] = None,
            secondary_connection_string_alias: Optional[str] = None) -> NamespaceDisasterRecoveryConfig
    func GetNamespaceDisasterRecoveryConfig(ctx *Context, name string, id IDInput, state *NamespaceDisasterRecoveryConfigState, opts ...ResourceOption) (*NamespaceDisasterRecoveryConfig, error)
    public static NamespaceDisasterRecoveryConfig Get(string name, Input<string> id, NamespaceDisasterRecoveryConfigState? state, CustomResourceOptions? opts = null)
    public static NamespaceDisasterRecoveryConfig get(String name, Output<String> id, NamespaceDisasterRecoveryConfigState state, CustomResourceOptions options)
    resources:  _:    type: azure:servicebus:NamespaceDisasterRecoveryConfig    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DefaultPrimaryKey string
    The primary access key for the authorization rule RootManageSharedAccessKey.
    DefaultSecondaryKey string
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    Name string
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    PartnerNamespaceId string
    The ID of the Service Bus Namespace to replicate to.
    PrimaryConnectionStringAlias string
    The alias Primary Connection String for the ServiceBus Namespace.
    PrimaryNamespaceId string
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    SecondaryConnectionStringAlias string
    The alias Secondary Connection String for the ServiceBus Namespace
    DefaultPrimaryKey string
    The primary access key for the authorization rule RootManageSharedAccessKey.
    DefaultSecondaryKey string
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    Name string
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    PartnerNamespaceId string
    The ID of the Service Bus Namespace to replicate to.
    PrimaryConnectionStringAlias string
    The alias Primary Connection String for the ServiceBus Namespace.
    PrimaryNamespaceId string
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    SecondaryConnectionStringAlias string
    The alias Secondary Connection String for the ServiceBus Namespace
    defaultPrimaryKey String
    The primary access key for the authorization rule RootManageSharedAccessKey.
    defaultSecondaryKey String
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    name String
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    partnerNamespaceId String
    The ID of the Service Bus Namespace to replicate to.
    primaryConnectionStringAlias String
    The alias Primary Connection String for the ServiceBus Namespace.
    primaryNamespaceId String
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    secondaryConnectionStringAlias String
    The alias Secondary Connection String for the ServiceBus Namespace
    defaultPrimaryKey string
    The primary access key for the authorization rule RootManageSharedAccessKey.
    defaultSecondaryKey string
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    name string
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    partnerNamespaceId string
    The ID of the Service Bus Namespace to replicate to.
    primaryConnectionStringAlias string
    The alias Primary Connection String for the ServiceBus Namespace.
    primaryNamespaceId string
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    secondaryConnectionStringAlias string
    The alias Secondary Connection String for the ServiceBus Namespace
    default_primary_key str
    The primary access key for the authorization rule RootManageSharedAccessKey.
    default_secondary_key str
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    name str
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    partner_namespace_id str
    The ID of the Service Bus Namespace to replicate to.
    primary_connection_string_alias str
    The alias Primary Connection String for the ServiceBus Namespace.
    primary_namespace_id str
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    secondary_connection_string_alias str
    The alias Secondary Connection String for the ServiceBus Namespace
    defaultPrimaryKey String
    The primary access key for the authorization rule RootManageSharedAccessKey.
    defaultSecondaryKey String
    The secondary access key for the authorization rule RootManageSharedAccessKey.
    name String
    Specifies the name of the Disaster Recovery Config. This is the alias DNS name that will be created. Changing this forces a new resource to be created.
    partnerNamespaceId String
    The ID of the Service Bus Namespace to replicate to.
    primaryConnectionStringAlias String
    The alias Primary Connection String for the ServiceBus Namespace.
    primaryNamespaceId String
    The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
    secondaryConnectionStringAlias String
    The alias Secondary Connection String for the ServiceBus Namespace

    Import

    Service Bus DR configs can be imported using the resource id, e.g.

     $ pulumi import azure:servicebus/namespaceDisasterRecoveryConfig:NamespaceDisasterRecoveryConfig config1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ServiceBus/namespaces/namespace1/disasterRecoveryConfigs/config1
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.