This Azure Graph query will list all the VNIC’s in all subscriptions that aren’t connected to Virtual Machines, Network Security Group or Private EndPoints.
1 2 3 4 5 |
//Query list all Network Adpaters that are not connected to either a VM, NSG or Private End Points. resources | where type == "microsoft.network/networkinterfaces" and isnull(properties.virtualMachine) and isnull(properties.networkSecurityGroup.id) and isnull(properties.privateEndpoint) | project name, resourceGroup | sort by name asc |