Wednesday, October 21, 2026

Azure: Kusto query to identify unused VNets

 If you have a large environment with many landing zones, it is easy to lose track of what is being used and not. This KQL does a quick check on all VNets and looks for unused VNets. It checks for vNICs, private endpoints, load balancers, and app gateways. If non of those are present, the VNet will show in the list.

This means that the VNet is most likely not in used (there are other resources such as Azure Firewall and a few more, so this is not 100%) and you can go to the VNet -> Connected devices to verify if it's used or not.

Link to the KQL on Github