![]() |
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. Creating a Virtual Network using Azure PowerShellTo execute the desired action, kindly access Windows PowerShell and proceed by selecting “Run as administrator” from the context menu upon right-clicking. Enter the following commands to create a Virtual Network using Azure PowerShell Step 1: Set up the Azure services in PowerShellAs the initial step, establish the Azure services within PowerShell environment by executing the following command:
In addition, you may need to adjust the execution policy to ‘RemoteSigned’ by running the following command:
Step 2: Connect to your Azure accountTo connect to your Azure account, Navigate to your azure portal and search for tenant properties, under that find the tenant Id. copy the tenant Id. To establish a connection, kindly utilize the “Connect-AzAccount” command in PowerShell, specifying your Tenant ID as follows:
It will ask to choose your Azure account and after Authentication is completed, you can navigate back to the PowerShell. Step 3: Create a Resource GroupExecute the following command in PowerShell to create a new resource group, ensuring to replace
Step 4: Create a Virtual Newtwork in the resource groupEstablish a Virtual Network within the designated resource group by executing the following PowerShell command:
Ensure to replace placeholders such as Step 5: Check whether the Virtual Network is created or notVerify the existence of the Virtual Network by executing the following command in the PowerShell environment.
Deleting a Virtual network using PowerShellThere 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.
Ensure that you replace Step 2: Validate the deletion status of the virtual network by executing the following command.
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.
Deleting a Virtual Network using Azure PortalHere is the detail steps to delete the virtual network using the azure portal. Step 1: Access Azure Portal
Step 2: Sign In
Step 3: Navigate to Virtual Network Section
Step 4: Explore Virtual Networks
Step 5: Select Virtual NetworkIdentify and select the specific virtual network that you intend to delete. Step 6: Review Connected Resources
Step 7: Handle Connected Resources
Step 8: Initiate Virtual Network Deletion
Step 9: Start Deletion Process
Step 10: Confirm Deletion
ConclusionDeleting Virtual Network can be cost-effective and resource optimisation when it is not longer required but, Ensure and back-up the underlying critical resources with the virtual network. Delete Virtual Network in Azure – FAQsWhy would I want to delete a virtual network in Azure?
Will deleting a virtual network affect other resources in my Azure environment?
Can I undo the deletion of a virtual network in Azure?
Is there a way to automate the deletion of virtual networks in Azure?
What precautions needed to be taken while deleting a Virtual network?
|
Reffered: https://www.geeksforgeeks.org
Microsoft Azure |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |