Well, in this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzVirtualNetworkSubnetConfig Azure PowerShell cmdlet with examples.
Get-AzVirtualNetworkSubnetConfig is an excellent Azure PowerShell cmdlet for retrieving the details of a subnet inside a Virtual network.
Well, let’s discuss the syntax of this Azure PowerShell command.
Table of Contents
Syntax:
Below is the syntax of this PowerShell cmdlet.
Get-AzVirtualNetworkSubnetConfig
[- Subnet Name <String>]
-VirtualNetwork <PSVirtualNetwork>
Example:
The below example creates a virtual network named MyVirtualNetwork and subnet mySubnet in the Resource Group Demo123. It then gets you data about the subnet named mySubnet.
$mySubnet = New-AzVirtualNetworkSubnetConfig -Name mySubnet -AddressPrefix "10.0.1.0/24"
$myvirtualNetwork = New-AzVirtualNetwork -Name MyVirtualNetwork -ResourceGroupName Demo123 -Location centralus -AddressPrefix "10.0.0.0/16" -Subnet $mySubnet
Get-AzVirtualNetworkSubnetConfig -Name mySubnet -VirtualNetwork $myvirtualNetworkOnce I executed the above Azure PowerShell script, I got the output below.
Name : mySubnet
Id : /subscriptions/1cdf43xx-dee9-5654-8hjy-feaa65h5cbd1/
resourceGroups/Demo123/providers/Microsoft.Netwo
rk/virtualNetworks/MyVirtualNetwork/subnets/mySubn
et
Etag : W/"143cd988-1f4f-46dc-b720-c13d31cee1d1"
ProvisioningState : Succeeded
AddressPrefix : {10.0.1.0/24}
IpConfigurations : []
ResourceNavigationLinks : []
ServiceAssociationLinks : []
NetworkSecurityGroup : null
RouteTable : null
NatGateway : null
ServiceEndpoints : []
ServiceEndpointPolicies : []
PrivateEndpoints : []
PrivateEndpointNetworkPolicies : Disabled
PrivateLinkServiceNetworkPolicies : Enabled
You can see it here

You may also like following the articles below
Wrapping Up
Well, in this article, we discussed the syntax and usage of the Get-AzVirtualNetworkSubnetConfig Azure PowerShell cmdlet with examples.

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, 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.
