Get-AzVirtualNetworkSubnetConfig
Get-AzVirtualNetworkSubnetConfig
Description
Gets the details of a subnet configuration within an Azure virtual network.
This cmdlet retrieves the properties of a specific subnet, such as its address prefix, network security group, route table, and service endpoints.
Syntax
Get-AzVirtualNetworkSubnetConfig
[-Name ]
[-VirtualNetwork ]
[-DefaultProfile ]
[]
Parameters
| Name | Type | Description |
|---|---|---|
| -Name | [String] | Specifies the name of the subnet configuration to retrieve. |
| -VirtualNetwork | [PSVirtualNetwork] | Specifies the virtual network object that contains the subnet configuration. |
| -DefaultProfile | [IAzureContextContainer] | The credentials, account, tenant, and subscription for the cloud service. |
Examples
Example 1: Get a specific subnet by name
Get-AzVirtualNetworkSubnetConfig -Name "MySubnet" -VirtualNetwork $vnet
Example 2: Get all subnets in a virtual network
Get-AzVirtualNetworkSubnetConfig -VirtualNetwork $vnet