About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
powershell_heavy
⚠️
missing_linux_example
⚠️
windows_tools
Summary:
The documentation provides detailed instructions for the Azure Portal (web UI) and Azure PowerShell, but does not include any examples or guidance for Linux users or for the Azure CLI, which is cross-platform. All command-line automation is shown exclusively with PowerShell cmdlets, and file editing is demonstrated with Notepad, a Windows tool. There are no bash, shell, or Azure CLI examples, nor any mention of Linux-native editors or workflows.
Recommendations:
- Add equivalent Azure CLI (az) examples for all PowerShell command-line steps, including exporting, editing, and redeploying ARM templates.
- Demonstrate file editing with cross-platform editors (e.g., vim, nano, code) or use generic language (e.g., 'open the file in your preferred editor').
- Explicitly mention that all steps can be performed from Linux, macOS, or Windows, and provide any OS-specific notes if needed.
- Where possible, provide bash/shell script snippets for automation, or at least reference the Azure CLI documentation for Linux/macOS users.
- Ensure that references to tools and commands are not Windows-specific unless absolutely necessary, and always provide alternatives for other platforms.
Create pull request
Flagged Code Snippets
1. Obtain the resource ID of the virtual network that you want to move to the target region, and then place it in a variable by using [Get-AzVirtualNetwork](/powershell/module/az.network/get-azvirtualnetwork):
1. To obtain region location codes, you can use the Azure PowerShell cmdlet [Get-AzLocation](/powershell/module/az.resources/get-azlocation) by running the following command:
1. Save the *\<resource-group-name>.json* file.
---
## Redeploy
# [Portal](#tab/azure-portal)
1. To choose the subscription where the target virtual network is deployed, select **Basics** > **Subscription**.
1. To choose the resource group where the target virtual network is deployed, select **Basics** > **Resource group**.
If you need to create a new resource group for the target virtual network, select **Create new**. Make sure that the name isn't the same as the source resource group name in the existing virtual network.
1. Verify that **Basics** > **Location** is set to the target location where you want the virtual network to be deployed.
1. Under **Settings**, verify that the name matches the name that you entered previously in the parameters editor.
1. Select the **Terms and Conditions** check box.
1. To deploy the target virtual network, select **Purchase**.
1. [Reconfigure Virtual Network Peering](/azure/virtual-network/virtual-network-manage-peering).
1. Enable Connection Monitor by following the guidelines in ([Migrate to Connection monitor from Network performance monitor](/azure/network-watcher/migrate-to-connection-monitor-from-network-performance-monitor)).
1. Enable the DDoS Protection Plan. After the move, the autotuned policy thresholds for all the protected public IP addresses in the virtual network are reset.
- (Optional) Reconfigure the Network security Group (NSG), Application Security Group (ASG), and User Defined Route (UDR) to the target virtual network subnet which was previously associated to source virtual network subnet and now moved to target region.
- (Optional) Reconfigure the NAT-Gateway to the target virtual network subnet which was previously associated to source virtual network subnet and now moved to target region.
- (Optional) Diagnostic settings: Reconfigure the diagnostic setting for the target virtual network to send the logs to log analytic workspace/storage account/event hub which was relocated as mentioned in prepare.
# [PowerShell](#tab/azure-powershell)
1. Create a resource group in the target region for the target virtual network to be deployed by using [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup):
1. To verify that the resources were created in the target region, use [Get-AzResourceGroup](/powershell/module/az.resources/get-azresourcegroup) and [Get-AzVirtualNetwork](/powershell/module/az.network/get-azvirtualnetwork):
1. [Reconfigure Virtual Network Peering](/azure/virtual-network/scripts/virtual-network-powershell-sample-peer-two-virtual-networks).
1. Enable Connection Monitor by following the guidelines in ([Migrate to Connection monitor from Network performance monitor](/azure/network-watcher/migrate-to-connection-monitor-from-network-performance-monitor)).
1. Enable the DDoS Protection Plan. After the move, the autotuned policy thresholds for all the protected public IP addresses in the virtual network are reset.
---
## Discard
# [Portal](#tab/azure-portal)
To discard the target virtual network, you delete the resource group that contains the target virtual network. To do so:
1. On the Azure portal dashboard, select the resource group.
1. At the top of the **Overview** pane, select **Delete**.
# [PowerShell](#tab/azure-powershell)
N/A
---
## Clean up
# [Portal](#tab/azure-portal)
To commit the changes and complete the virtual network move, you delete the source virtual network or resource group. To do so:
1. On the Azure portal dashboard, select the virtual network or resource group.
1. At the top of each pane, select **Delete**.
# [PowerShell](#tab/azure-powershell)
To commit your changes and complete the virtual network move, do either of the following step:
- Delete the resource group by using [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup):
1. Export the source virtual network to a .json file in the directory where you execute the command [Export-AzResourceGroup](/powershell/module/az.resources/export-azresourcegroup):
1. Deploy the edited *\<resource-group-name>.json* file to the resource group that you created in the previous step by using [New-AzResourceGroupDeployment](/powershell/module/az.resources/new-azresourcegroupdeployment):
- Delete the source virtual network by using [Remove-AzVirtualNetwork](/powershell/module/az.network/remove-azvirtualnetwork):