In this article, we will discuss all the get-azvirtualnetwork Azure PowerShell cmdlets. Syntax and usage of get-azvirtualnetwork Azure PowerShell cmdlet with examples.
Table of Contents
Get-AzVirtualNetwork
GetAzVirtualNetwork is an excellent Azure PowerShell cmdlet that helps you to retrieve the lists of virtual networks under a resource group.
Syntax:
Get-AzVirtualNetwork -Name [Your Virtual network name] -ResourceGroupName [Your ResourceGroup name]
Example:
In the below example, Demo123-vnet is the name of the virtual network and Demo123 is the name of the resource group.
Get-AzVirtualNetwork -Name Demo123-vnet -ResourceGroupName Demo123
Once I executed the above Azure PowerShell cmdlet, I got the below output.
Name : Demo123-vnet
ResourceGroupName : Demo123
Location : eastus
Id : /subscriptions/1cdf43xx-dee9-5654-8hjy-feaa65h5cbd1/resourceG
roups/Demo123/providers/Microsoft.Network/virtualNetworks/Dem
o123-vnet
Etag : W/"58a65107-e405-4447-8f30-d3698742fa31"
ResourceGuid : 2d383a0a-3ade-4db9-877a-b3a610b707ec
ProvisioningState : Succeeded
Tags :
AddressSpace : {
"AddressPrefixes": [
"10.0.0.0/16"
]
}
DhcpOptions : {}
FlowTimeoutInMinutes : null
Subnets : [
{
"Delegations": [],
"Name": "default",
"Etag": "W/\"58a65107-e405-7665-8f30-d3908742fa31\"",
"Id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd
1/resourceGroups/Demo123/providers/Microsoft.Network/virtualN
etworks/Demo123-vnet/subnets/default",
"AddressPrefix": [
"10.0.0.0/24"
],
"IpConfigurations": [
{
"Id": "/subscriptions/1cdf43xx-dee9-5654-8hjy-feaa65h5cbd1
/resourceGroups/Demo123/providers/Microsoft.Network/netw
orkInterfaces/tsinfovm1353/ipConfigurations/ipconfig1"
}
],
"ServiceAssociationLinks": [],
"ResourceNavigationLinks": [],
"ServiceEndpoints": [],
"ServiceEndpointPolicies": [],
"PrivateEndpoints": [],
"ProvisioningState": "Succeeded",
"PrivateEndpointNetworkPolicies": "Enabled",
"PrivateLinkServiceNetworkPolicies": "Enabled",
"IpAllocations": []
}
]
VirtualNetworkPeerings : []
EnableDdosProtection : false
DdosProtectionPlan : null
ExtendedLocation : null
You can see it here
You may also like following the articles below
- Get-AzVirtualNetworkSubnetConfig
- Azure PowerShell List Resource Groups
- Get Storage Accounts Azure PowerShell
- Azure PowerShell Get VM Public IP
- Azure PowerShell List Virtual Machines
- How To Install Azure PowerShell
Wrapping Up
Well, here we discussed the usage and syntax of the GetAzVirtualNetwork Azure PowerShell cmdlet with example. Thanks for showing interest in reading this article. Hope it helps !!!
I am Rajkishore, and I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.