Deleting a Virtual network using PowerShell
There are multiple ways to create or delete a virtual network. Either we can delete the virtual network from the Azure portal directly or We can use commands to delete the virtual network using the PowerShell. Let us see how to delete a virtual network using PowerShell.
Step 1: To remove the Virtual Network, please execute the following command in PowerShell.
Remove-AzVirtualNetwork -Name <your-vnet-name> -ResourceGroupName <your-resource-group-name>
Ensure that you replace <your-vnet-name>
with the name of your Virtual Network and <your-resource-group-name>
with the name of your resource group.
Step 2: Validate the deletion status of the virtual network by executing the following command.
Get-AzVirtualNetwork -Name myVnet001
Step 3: In the absence of a virtual network bearing the specified name, the system will display no results or information pertaining to it.
Step 4: In addition, you may navigate to the Azure portal and access the “Marketplace” section, followed by selecting “Virtual Networks” to verify the absence of any virtual network bearing the specified name.
To delete the Virtual network using Azure Portal, Navigate to the Virtual Networks service in the marketplace and Delete the associated Vnets and subnets using the Delete option.
How to Delete Virtual Network in Azure
We often create virtual networks in Azure to manage and maintain our virtual machines. When the virtual machines or resources are no longer needed, we manage them by deleting the virtual machines, and sometimes we may also find the virtual network is no longer needed. We may find the VNET no longer needed considering the factors including resource usage, project lifecycle, and cost optimization. In this article, let us understand deleting a Virtual Network in Azure with different approaches. Before diving into the topic, let us have an overview of the Virtual network in Azure.
Azure Virtual Network allows its customers to create, manage, monitor, and secure connectivity between Azure resources and their on-premise environments.
Contact Us