Create Pull Request
| Date | Scan | Status | Result |
|---|---|---|---|
| 2025-07-12 23:44 | #41 | cancelled |
Biased
|
| 2025-07-12 00:58 | #8 | cancelled |
Clean
|
| 2025-07-10 05:06 | #7 | processing |
Clean
|
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):
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):