azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Azure service Bus geo-recovery automation using az bash commands

Open vivuu1989 opened this issue 1 year ago • 5 comments

In MS docs for AzureCLI, we couldn't find, az command to do perform the Switchover activity from our primary Service Bus to the Secondary Service Bus.

We are performing, below activities as part of the switchover and couldn't find the required AZ commands to fulfill our requirements.

Task 1. Re-initiate the Pairing with secondary namespace (for which the alias already present, for which we already have the alias created). Here we cold find only to create a new paring , but not with existing.

az servicebus georecovery-alias create --alias <prim-second-existing alias-name> --namespace-name <primary-sb-namespace-name> --partner-namespace <secondary-sb-namespace-name>  --resource-group <primary-sb-namespace-RGName>

Perform Failover:-

az servicebus georecovery-alias fail-over <prim-second-existing alias-name> --ids <secondary-sb-namespace-name>  --is-safe-failover y -namespace-name <primary-sb-namespace-name> --resource-group <primary-sb-namespace-RGName>

task3:- Once Failover done, Delete Ques and topics from the Primary-SB-instance Namespace. Here how to find the pending ques and topics in the primary instance to set it for deletion

    az servicebus topic delete --ids pending-TopicIds --name yyyy --namespace-name <primary-sb-namespace-name> --resource-group <primary-sb-namespace-RGName> --subscription ssssss

For ques

    az servicebus queue delete --ids pending-queids --name que-name --namespace-name <primary-sb-namespace-name> --resource-group <primary-sb-namespace-RGName> --subscription ssssssss

vivuu1989 avatar Feb 17 '24 17:02 vivuu1989

Hi @vivuu1989 Find similar issue https://github.com/Azure/azure-cli/issues/28383.

Issue title Azure service Bus geo-recovery automation using az bash commands
Create time 2024-02-17
Comment number 1

Please confirm if this resolves your issue.

Thank you for opening this issue, we will look into it.

yonzhan avatar Feb 19 '24 02:02 yonzhan

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Saglodha.

@Saglodha, could you please take a look at this issue?

MoChilia avatar Feb 22 '24 07:02 MoChilia

Hi @vivuu1989 / @MoChilia , I would like to have some additional details here. Are you trying to re-use primary namespace again to pair with secondary after failing over once? Do you want to delete queues/topic from primary namespace so that it could be re-used as fresh namespace?

In this case, only fail forward semantics are supported. Please refer here: https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-geo-dr#failover-flow

Saglodha avatar May 07 '24 05:05 Saglodha