Getting an error when trying to get an agent node pool node count
mykolaichuk opened this issue · comments
Vadym Mykolaichuk commented
I have the following query which fails when I try to get node count. Without NodeCount = properties_agentPoolProfiles.count query will work.
Resources
| where type == 'microsoft.containerservice/managedclusters'
| mv-expand properties.agentPoolProfiles
| where properties_agentPoolProfiles.name == "pool01"
| join kind=inner (
resourcecontainers
| where type == 'microsoft.resources/subscriptions'
| project subscriptionId, subscriptionName = name)
on subscriptionId
| where subscriptionName == 'Staging'
| project subscriptionName, name, location, VMSize = properties_agentPoolProfiles.vmSize, NodePoolName = properties_agentPoolProfiles.name, NodeCount = properties_agentPoolProfiles.count
| sort by name asc
Appreciate any help on this!
Alexander Sloutsky commented
Some keywords (e.g. count) may require escaping
Try:
Resources
| where type == 'microsoft.containerservice/managedclusters'
| mv-expand properties.agentPoolProfiles
| where properties_agentPoolProfiles.name == "pool01"
| join kind=inner (
resourcecontainers
| where type == 'microsoft.resources/subscriptions'
| project subscriptionId, subscriptionName = name)
on subscriptionId
| where subscriptionName == 'Staging'
| project subscriptionName, name, location, VMSize = properties_agentPoolProfiles.vmSize, NodePoolName = properties_agentPoolProfiles.name, NodeCount = properties_agentPoolProfiles.['count']
| sort by name asc
Vadym Mykolaichuk commented
Some keywords (e.g. count) may require escaping
Try:
Resources | where type == 'microsoft.containerservice/managedclusters' | mv-expand properties.agentPoolProfiles | where properties_agentPoolProfiles.name == "pool01" | join kind=inner ( resourcecontainers | where type == 'microsoft.resources/subscriptions' | project subscriptionId, subscriptionName = name) on subscriptionId | where subscriptionName == 'Staging' | project subscriptionName, name, location, VMSize = properties_agentPoolProfiles.vmSize, NodePoolName = properties_agentPoolProfiles.name, NodeCount = properties_agentPoolProfiles.['count'] | sort by name asc
thanks, it worked!