Skip to content

Commit 34571d4

Browse files
Added additional methods for creation / promotion of Geo-Replication namespaces
1 parent 4e3b774 commit 34571d4

File tree

1 file changed

+57
-7
lines changed

1 file changed

+57
-7
lines changed

articles/service-bus-messaging/service-bus-geo-replication.md

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ The Geo-Replication feature enables customers to configure a secondary region to
120120

121121
## Setup
122122

123-
The following section is an overview to set up the Geo-Replication feature on a new namespace.
123+
### Using Azure Portal
124+
125+
The following section is an overview to set up the Geo-Replication feature on a new namespace through the Azure portal.
124126
> [!NOTE]
125127
> This experience might change during public preview. We'll update this document accordingly.
126128
@@ -130,6 +132,44 @@ The following section is an overview to set up the Geo-Replication feature on a
130132
1. Either check the **Synchronous replication** checkbox, or specify a value for the **Async Replication - Max Replication lag** value in seconds.
131133
:::image type="content" source="./media/service-bus-geo-replication/create-namespace-with-geo-replication.png" alt-text="Screenshot showing the Create Namespace experience with Geo-Replication enabled.":::
132134

135+
### Using Bicep template
136+
137+
To create a namespace with the Geo-Replication feature enabled, add the *geoDataReplication* properties section as shown below.
138+
139+
To create a queue with duplicate detection enabled, set requiresDuplicateDetection to true in the queue properties section. For more information, see Microsoft.ServiceBus namespaces/queues template reference. Specify a value for the duplicateDetectionHistoryTimeWindow property to set the size of the duplicate detection window. In the following example, it's set to one day.
140+
141+
```bicep
142+
param serviceBusName string
143+
param primaryLocation string
144+
param secondaryLocation string
145+
param maxReplicationLagInSeconds int
146+
147+
resource sb 'Microsoft.ServiceBus/namespaces@2023-01-01-preview' = {
148+
name: serviceBusName
149+
location: primaryLocation
150+
sku: {
151+
name: 'Premium'
152+
tier: 'Premium'
153+
capacity: 1
154+
}
155+
properties: {
156+
geoDataReplication: {
157+
maxReplicationLagDurationInSeconds: maxReplicationLagInSeconds
158+
locations: [
159+
{
160+
locationName: primaryLocation
161+
roleType: 'Primary'
162+
}
163+
{
164+
locationName: secondaryLocation
165+
roleType: 'Secondary'
166+
}
167+
]
168+
}
169+
}
170+
}
171+
```
172+
133173
## Management
134174

135175
Once you create a namespace with the Geo-Replication feature enabled, you can manage the feature from the **Replication (preview)** blade.
@@ -146,15 +186,11 @@ To remove a secondary region, click on the **...**-ellipsis next to the region,
146186

147187
### Promotion flow
148188

149-
A promotion is triggered manually by the customer (either explicitly through a command, or through client owned business logic that triggers the command) and never by Azure. It gives the customer full ownership and visibility for outage resolution on Azure's backbone. In the portal, click on the **Promote** icon, and follow the instructions in the pop-up blade to delete the region.
150-
151-
When choosing **Planned** promotion, the service waits to catch up the replication lag before initiating the promotion. On the other hand, when choosing **Forced** promotion, the service immediately initiates the promotion. The namespace will be placed in read-only mode from the time that a promotion is requested, until the time that the promotion has completed. It is possible to do a forced promotion at any time after a planned promotion has been initiated. This puts the user in control to expedite the promotion, when a planned failover takes longer than desired.
189+
A promotion is triggered manually by the customer (either explicitly through a command, or through client owned business logic that triggers the command) and never by Azure. It gives the customer full ownership and visibility for outage resolution on Azure's backbone. When choosing **Planned** promotion, the service waits to catch up the replication lag before initiating the promotion. On the other hand, when choosing **Forced** promotion, the service immediately initiates the promotion. The namespace will be placed in read-only mode from the time that a promotion is requested, until the time that the promotion has completed. It is possible to do a forced promotion at any time after a planned promotion has been initiated. This puts the user in control to expedite the promotion, when a planned failover takes longer than desired.
152190

153191
> [!IMPORTANT]
154192
> When using **Forced** promotion, any data that has not been replicated may be lost.
155193
156-
:::image type="content" source="./media/service-bus-geo-replication/promote-secondary-region.png" alt-text="Screeshot showing the flow to promote secondary region." lightbox="./media/service-bus-geo-replication/promote-secondary-region.png":::
157-
158194
After the promotion is initiated:
159195

160196
1. The hostname is updated to point to the secondary region, which can take up to a few minutes.
@@ -163,11 +199,25 @@ After the promotion is initiated:
163199
> ping *your-namespace-fully-qualified-name*
164200
165201
1. Clients automatically reconnect to the secondary region.
166-
:::image type="content" source="./media/service-bus-geo-replication/promotion-flow.png" alt-text="Screenshot of the portal showing the flow of promotion from primary to secondary region." lightbox="./media/service-bus-geo-replication/promotion-flow.png":::
167202

203+
:::image type="content" source="./media/service-bus-geo-replication/promotion-flow.png" alt-text="Screenshot of the portal showing the flow of promotion from primary to secondary region." lightbox="./media/service-bus-geo-replication/promotion-flow.png":::
168204

169205
You can automate promotion either with monitoring systems, or with custom-built monitoring solutions. However, such automation takes extra planning and work, which is out of the scope of this article.
170206

207+
### Using Azure Portal
208+
209+
In the portal, click on the **Promote** icon, and follow the instructions in the pop-up blade to delete the region.
210+
211+
:::image type="content" source="./media/service-bus-geo-replication/promote-secondary-region.png" alt-text="Screeshot showing the flow to promote secondary region." lightbox="./media/service-bus-geo-replication/promote-secondary-region.png":::
212+
213+
### Using Azure CLI
214+
215+
Execute theAzure CLI command below to initiate the promotion. The **Force** property is optional, and defaults to **false**.
216+
217+
```cli
218+
az rest --method post --url https://management.azure.com/subscriptions/<subscriptionId>/resourceGroups/<resourceGroup>/providers/Microsoft.ServiceBus/namespaces/<namespaceName>/failover?api-version=2023-01-01-preview --body "{'properties': {'PrimaryLocation': '<newPrimaryocation>', 'api-version':'2023-01-01-preview', 'Force':'false'}}"
219+
```
220+
171221
### Monitoring data replication
172222
Users can monitor the progress of the replication job by monitoring the replication lag metric in Log Analytics.
173223
- Enable Metrics logs in your Service Bus namespace as described at [Monitor Azure Service Bus](/azure/service-bus-messaging/monitor-service-bus).

0 commit comments

Comments
 (0)