We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
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:
- Partner
Namespace stringId - The ID of the Service Bus Namespace to replicate to.
- Primary
Namespace stringId - 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 stringId - The ID of the Service Bus Namespace to replicate to.
- Primary
Namespace stringId - 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 StringId - The ID of the Service Bus Namespace to replicate to.
- primary
Namespace StringId - 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 stringId - The ID of the Service Bus Namespace to replicate to.
- primary
Namespace stringId - 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_ strid - The ID of the Service Bus Namespace to replicate to.
- primary_
namespace_ strid - 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.
- partner
Namespace StringId - The ID of the Service Bus Namespace to replicate to.
- primary
Namespace StringId - 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:
- Default
Primary stringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - Default
Secondary stringKey - The secondary access key for the authorization rule
RootManageSharedAccessKey. - Id string
- The provider-assigned unique ID for this managed resource.
- Primary
Connection stringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- Secondary
Connection stringString Alias - The alias Secondary Connection String for the ServiceBus Namespace
- Default
Primary stringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - Default
Secondary stringKey - The secondary access key for the authorization rule
RootManageSharedAccessKey. - Id string
- The provider-assigned unique ID for this managed resource.
- Primary
Connection stringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- Secondary
Connection stringString Alias - The alias Secondary Connection String for the ServiceBus Namespace
- default
Primary StringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - default
Secondary StringKey - The secondary access key for the authorization rule
RootManageSharedAccessKey. - id String
- The provider-assigned unique ID for this managed resource.
- primary
Connection StringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- secondary
Connection StringString Alias - The alias Secondary Connection String for the ServiceBus Namespace
- default
Primary stringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - default
Secondary stringKey - The secondary access key for the authorization rule
RootManageSharedAccessKey. - id string
- The provider-assigned unique ID for this managed resource.
- primary
Connection stringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- secondary
Connection stringString Alias - The alias Secondary Connection String for the ServiceBus Namespace
- default_
primary_ strkey - The primary access key for the authorization rule
RootManageSharedAccessKey. - default_
secondary_ strkey - The secondary access key for the authorization rule
RootManageSharedAccessKey. - id str
- The provider-assigned unique ID for this managed resource.
- primary_
connection_ strstring_ alias - The alias Primary Connection String for the ServiceBus Namespace.
- secondary_
connection_ strstring_ alias - The alias Secondary Connection String for the ServiceBus Namespace
- default
Primary StringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - default
Secondary StringKey - The secondary access key for the authorization rule
RootManageSharedAccessKey. - id String
- The provider-assigned unique ID for this managed resource.
- primary
Connection StringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- secondary
Connection StringString Alias - 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) -> NamespaceDisasterRecoveryConfigfunc 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.
- Default
Primary stringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - Default
Secondary stringKey - 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.
- Partner
Namespace stringId - The ID of the Service Bus Namespace to replicate to.
- Primary
Connection stringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- Primary
Namespace stringId - The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- Secondary
Connection stringString Alias - The alias Secondary Connection String for the ServiceBus Namespace
- Default
Primary stringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - Default
Secondary stringKey - 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.
- Partner
Namespace stringId - The ID of the Service Bus Namespace to replicate to.
- Primary
Connection stringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- Primary
Namespace stringId - The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- Secondary
Connection stringString Alias - The alias Secondary Connection String for the ServiceBus Namespace
- default
Primary StringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - default
Secondary StringKey - 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.
- partner
Namespace StringId - The ID of the Service Bus Namespace to replicate to.
- primary
Connection StringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- primary
Namespace StringId - The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- secondary
Connection StringString Alias - The alias Secondary Connection String for the ServiceBus Namespace
- default
Primary stringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - default
Secondary stringKey - 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.
- partner
Namespace stringId - The ID of the Service Bus Namespace to replicate to.
- primary
Connection stringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- primary
Namespace stringId - The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- secondary
Connection stringString Alias - The alias Secondary Connection String for the ServiceBus Namespace
- default_
primary_ strkey - The primary access key for the authorization rule
RootManageSharedAccessKey. - default_
secondary_ strkey - 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_ strid - The ID of the Service Bus Namespace to replicate to.
- primary_
connection_ strstring_ alias - The alias Primary Connection String for the ServiceBus Namespace.
- primary_
namespace_ strid - The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- secondary_
connection_ strstring_ alias - The alias Secondary Connection String for the ServiceBus Namespace
- default
Primary StringKey - The primary access key for the authorization rule
RootManageSharedAccessKey. - default
Secondary StringKey - 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.
- partner
Namespace StringId - The ID of the Service Bus Namespace to replicate to.
- primary
Connection StringString Alias - The alias Primary Connection String for the ServiceBus Namespace.
- primary
Namespace StringId - The ID of the primary Service Bus Namespace to replicate. Changing this forces a new resource to be created.
- secondary
Connection StringString Alias - 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
azurermTerraform Provider.
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
