Select Page

Another one, again demonstrating the use of extend and mv-expand to pull out the multi-valued array.

resources

| join kind=leftouter (ResourceContainers | where type==’microsoft.resources/subscriptions’ | project SubName=name, subscriptionId) on subscriptionId

| where type == “microsoft.network/virtualnetworks”

| extend vnetCount =array_length(properties.addressSpace.addressPrefixes)

| mv-expand vnet = properties.addressSpace.addressPrefixes

| project SubName, resourceGroup, name, vnetCount, vnet

| order by tostring(vnet) asc