1. Retrieve Subnet Information
Get-AzVirtualNetwork | Select-Object -ExpandProperty Subnets
Or, if you want details of a specific subnet:
Get-AzVirtualNetworkSubnetConfig -Name <SubnetName> -VirtualNetwork <VNetObject>
To get all subnets in a specific virtual network:
$vnet = Get-AzVirtualNetwork -Name "<VNetName>" -ResourceGroupName "<ResourceGroupName>"
$vnet.Subnets
2. Retrieve Route Table Information To list all route tables in your Azure subscription:
Get-AzRouteTable
To get details of a specific route table:
Get-AzRouteTable -Name "<RouteTableName>" -ResourceGroupName "<ResourceGroupName>"
To list the routes within a specific route table:
$routeTable = Get-AzRouteTable -Name "<RouteTableName>" -ResourceGroupName "<ResourceGroupName>"
$routeTable.Routes
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin