Quick Tip: Listing all IaaS VMs or PaaS Roles on an Azure Virtual Network via PowerShell
When managing Microsoft Azure Virtual Networks via the Azure Management Portal, we can easily see a list of IaaS Virtual Machines and/or PaaS web/worker roles that are connected to a particular virtual network, as shown below.
Question: How can I determine this same type of list when using PowerShell to manage my Azure subscription?
Answer: Virtual networks are bound to Azure cloud service deployments for IaaS Virtual Machines and PaaS web/worker roles. Use the following PowerShell code snippet to display the list of cloud services, roles and instances that are connected to a particular Azure Virtual Network.
-Property VNetName `
-EQ "enter-vnet-name") |
-ServiceName $_.ServiceName `