In order to set up redundancies to prevent an outage in the case Azure has a regional hard down (such as the one that occurred in South Central a few weeks ago; it does happen so be prepared), we had to upgrade our Azure Service Bus from Standard Messaging to Premium. Unfortunately, this can’t be done via the Azure Portal UI so we had to turn to Powershell. This is how to do it.
Note: This does not replace your existing service bus that you are migrating. This creates a copy of all settings of your current service bus and moves them to a premium service bus. The two exist side-by-side until you blow away the old service bus.
Install modules for Powershell
First, make sure the Azure module is installed.
Second, add the service bus module:
install-module azurerm.servicebus -force
Connect to your Azure account
Run Connect-AzureRmAccount to connect to your Azure account. You’ll see something like this come back:
Account: firstname.lastname@example.org Environment: AzureCloud Subscription: xxxx-xxxx-xxxx-xxxx Tenant: xxxx-xxxx-xxxx-xxxx
You can only target one subscription at a time. If “Subscription” above is not correct in that the service bus is in another subscription, use the Set-AzureRmContext command.
Performing the migration
The order of the commands you’ll need to perform are as following:
- New-AzureRmServiceBusNamespace – Create a new namespace of scale “Premium” to put the service bus in
- Start-AzureRmServiceBusMigration – Begin the migration process
- Get-AzureRmServiceBusMigration – Monitor the progress of the migration
- Complete-AzureRmServiceBusMigration – Finalize and commit the migration
The documentation linked on the above commands is very good and gives you examples of what needs to be done for each. Good luck!