Skip to content

Commit d403921

Browse files
authored
Update Kusto Graph Explorer Queries.md
1 parent 112d07e commit d403921

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

AZURE/Kusto Graph Explorer Queries.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,49 @@ These can be increased to 5 joins and 4 mv-expands for your tenant, in order to
1818
which is used by everything EXCEPT for the Azure Resource Graph Explorer, which has an anomalous limit of 4 joins and 3 mv-expands.
1919
However, you can build and save the query in the portal, and run it under Azure Resource Graph queries (which does use the REST API).
2020

21+
To test for the query limits on your tenant, try the following in a PowerShell window (after doing Login-AzAccount):
22+
```
23+
$q = 'Resources
24+
| where type =~ "microsoft.network/networkinterfaces"
25+
| mv-expand ipConfigurations = properties.ipConfigurations
26+
| extend ipCount = array_length(properties.ipConfigurations)
27+
| extend privateIPType = tostring(ipConfigurations.properties["privateIPAllocationMethod"])
28+
| extend privateIP = tostring(ipConfigurations.properties["privateIPAddress"])
29+
| extend subnetId = tostring(ipConfigurations.properties.subnet["id"])
30+
| extend publicIPid = tostring(ipConfigurations.properties["publicIPAddress"].id)
31+
| extend nicId = tostring(id)
32+
| join kind=leftouter (ResourceContainers | where type=~ "microsoft.resources/subscriptions"
33+
| project subscriptionName=name, subscriptionId) on subscriptionId
34+
| join kind=leftouter (Resources
35+
| where type contains "publicIPAddresses" and isnotempty(properties.ipAddress)
36+
| extend publicIP = tostring(properties.ipAddress),
37+
publicIPid = tostring(id)) on publicIPid
38+
| join kind=leftouter (Resources | where type =~ "microsoft.network/networksecuritygroups"
39+
| mv-expand nics = properties.networkInterfaces
40+
| extend nicId = tostring (nics.id),
41+
nicNSG = name,
42+
nicNSGgroup = resourceGroup ) on nicId
43+
| join kind=leftouter (Resources
44+
| where type =~ "microsoft.compute/virtualmachines" and isnotempty(properties.networkProfile.networkInterfaces)
45+
| extend vmName = name
46+
| extend vmSize = tostring(properties.hardwareProfile.vmSize)
47+
| extend osType = tostring(properties.storageProfile.osDisk.osType)
48+
| mv-expand nics = properties.networkProfile.networkInterfaces
49+
| extend nicId = tostring (nics.id) ) on nicId
50+
| join kind=leftouter (Resources | where type =~ "microsoft.network/networksecuritygroups"
51+
| mv-expand subnets = properties.subnets
52+
| extend subnetId = tostring(subnets.id),
53+
vnetName = split(tostring(subnets.id),"/")[8],
54+
subnetName = split(tostring(subnets.id),"/")[10],
55+
subnetNSG = name,
56+
subnetNSGgroup = resourceGroup
57+
) on subnetId
58+
| project subscriptionId, subscriptionName, nicName=name, resourceGroup, vmName, vmSize, osType, vnetName, subnetName, nicNSG, subnetNSG, location, ipCount, privateIPType, privateIP, publicIP, tags, subnetId, nicId'
59+
60+
Search-AzGraph -First 1000 -Query $Q | ft
61+
```
62+
If you get an error, then there is a quota limit in place.
63+
2164
The document (https://docs.microsoft.com/en-us/azure/governance/resource-graph/concepts/query-language#supported-tabulartop-level-operators)
2265
does state the max joins allowed is 3, however, production team overrides the limit to 4 for queries used in Azure Portal.
2366

0 commit comments

Comments
 (0)