How can I check which subnet is attached to my VM with azure power shell? I don't see any property to get subnet name.
I have tried to Get-AzureRmVM but there is no information about a subnet.
How can I check which subnet is attached to my VM with azure power shell? I don't see any property to get subnet name.
I have tried to Get-AzureRmVM but there is no information about a subnet.
The following command will work if you have the name of the VM's NIC:
(Get-AzureRmNetworkInterface -name "VM_NIC Name").ipconfigurations.subnet.id
You can get the NIC ID from the following if you don't already have it:
(Get-AzureRmVM -name "VM Name").networkprofile.networkinterfaces.id