Migrate to an availability zone-enabled ExpressRoute virtual network gateway using PowerShell
When you create an ExpressRoute virtual network gateway, you need to choose the gateway SKU. If you choose a higher-level SKU, more CPUs and network bandwidth are allocated to the gateway. As a result, the gateway can support higher network throughput and more dependable network connections to the virtual network.
The following SKUs are available for ExpressRoute virtual network gateways:
- Standard
- HighPerformance
- UltraPerformance
- ErGw1Az
- ErGw2Az
- ErGw3Az
- ErGwScale (Preview)
Prerequisites
- Review the Gateway migration article before you begin.
- You must have an existing ExpressRoute Virtual network gateway in your Azure subscription.
Working with Azure PowerShell
The steps and examples in this article use Azure PowerShell Az modules. To install the Az modules locally on your computer, see Install Azure PowerShell. To learn more about the new Az module, see Introducing the new Azure PowerShell Az module. PowerShell cmdlets are updated frequently. If you are not running the latest version, the values specified in the instructions may fail. To find the installed versions of PowerShell on your system, use the Get-Module -ListAvailable Az
cmdlet.
Migrate to a new gateway in using PowerShell
Here are the steps to migrate to a new gateway using PowerShell.
Clone the script
Clone the setup script from GitHub.
git clone https://github.com/Azure-Samples/azure-docs-powershell-samples/
Change to the directory where the script is located.
CD azure-docs-powershell-samples/expressroute-gateway/
Prepare the migration
This script creates a new ExpressRoute virtual network gateway on the same gateway subnet and connects it to your existing ExpressRoute circuits.
Identify the resource ID of the gateway that will be migrated.
$resourceId = Get-AzResource -Name {virtual network gateway name} $resourceId.Id
Run the PrepareMigration.ps1 script to prepare the migration.
gateway-migration/preparemigration.ps1
Enter the resource ID of your gateway.
Choose a name for your new resources, the new resource name will be added to the existing name. For example: existingresourcename_newname.
Enter an availability zone for your new gateway.
Run the migration
This script transfers the configuration from the old gateway to the new one.
Identify the resource ID of your new post-migration gateway. Use the resource name you given for this gateway in the previous step.
$resourceId = Get-AzResource -Name {virtual network gateway name} $resourceId.Id
Run the Migration.ps1 script to perform the migration.
gateway-migration/migration.ps1
Enter the resource ID of your premigration gateway.
Enter the resource ID of your post-migration gateway.
Commit the migration
This script deletes the old gateway and its connections.
Run the CommitMigration.ps1 script to complete the migration.
gateway-migration/commitmigration.ps1
Enter the resource ID of the premigration gateway.
Important
- Before running this step, verify that the new virtual network gateway has a working ExpressRoute connection.
- When migrating your gateway, you can expect possible interruption for a maximum of 30 seconds.
Next steps
- Learn more about designing for high availability.
- Plan for disaster recovery and using VPN as a backup.