Skip to content

Geo-replication#

Reliability · Service Bus · Rule · Preview · 2024_09 · Important

Enhance resilience to regional outages by replicating namespaces.

Description#

By default, an service bus namespace and its data and metadata is in a single region.

The geo-replication feature ensures that the metadata and data of a namespace are continuously replicated from a primary region to one or more secondary regions.

The following will be replicated:

  • Queues, topics, subscriptions, filters.
  • Data, which resides in the entities.
  • All state changes and property changes executed against the messages within a namespace.
  • Namespace configuration.

Replicating your namespace adds the following benefits:

  • Added resiliency for localized outages contained to a region.
  • Regional compartmentalization.

This feature allows promoting any secondary region to primary, reassigning the namespace name and switching roles between regions. Promotion is nearly instantaneous.

There are currently several limitations to the feature. For more details, refer to the documentation.

Recommendation#

Consider replicating service bus namespaces to improve resiliency to region outages.

Examples#

Configure with Azure template#

To deploy namespaces that pass this rule:

  • Set the sku.name property to Premium. This only applies to new namespaces.
    • For existing namespaces first, migrate to a namespace deployed with a premium SKU.
  • Configure the properties.geoDataReplication.locations array with two or more supported region elements.

For example:

Azure Template snippet
{
  "type": "Microsoft.ServiceBus/namespaces",
  "apiVersion": "2023-01-01-preview",
  "name": "[parameters('serviceBusName')]",
  "location": "[parameters('primaryLocation')]",
  "sku": {
    "name": "Premium",
    "tier": "Premium",
    "capacity": 1
  },
  "properties": {
    "geoDataReplication": {
      "maxReplicationLagDurationInSeconds": "[parameters('maxReplicationLagInSeconds')]",
      "locations": [
        {
          "locationName": "[parameters('primaryLocation')]",
          "roleType": "Primary"
        },
        {
          "locationName": "[parameters('secondaryLocation')]",
          "roleType": "Secondary"
        }
      ]
    }
  }
}

Configure with Bicep#

To deploy namespaces that pass this rule:

  • Set the sku.name property to Premium. This only applies to new namespaces.
    • For existing namespaces first, migrate to a namespace deployed with a premium SKU.
  • Configure the properties.geoDataReplication.locations array with two or more supported region elements.

For example:

Azure Bicep snippet
resource sb 'Microsoft.ServiceBus/namespaces@2023-01-01-preview' = {
  name: serviceBusName
  location: primaryLocation
  sku: {
    name: 'Premium'
    tier: 'Premium'
    capacity: 1
  }
  properties: {
    geoDataReplication: {
      maxReplicationLagDurationInSeconds: maxReplicationLagInSeconds
      locations: [
        {
          locationName: primaryLocation
          roleType: 'Primary'
        }
        {
          locationName: secondaryLocation
          roleType: 'Secondary'
        }
      ]
    }
  }
}

Notes#

This feature is only supported for the Premium SKU.

This feature is currently in preview.

Comments