Hi Ameet Desai
Thank you for reaching out.
The problem is to combine the two queries into one.
You can use union to combine them for the same result as expected.
union Query1, Query2
let Query1 = Resources
| where type == 'microsoft.network/virtualnetworks'
| extend subnets = properties.subnets
| mv-expand subnets
| project name, subnets.name, subnets.properties.addressPrefix, location, resourceGroup;
let Query2 = Resources
| where type =~ "microsoft.network/networksecuritygroups"
| project name, resourceGroup, subscriptionId
| sort by name asc;
union Query1, Query2
Kindly let me know if this work for you.
Rg.