Hi @Diptesh Kumar ,
It might just be an issue with case-sensitive "Resources" versus "resources". Try the lower-case "resources" table name.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am trying to execute following query from resource graph explorer and giving error as below
Resources
| where type =~ 'microsoft.compute/virtualmachines'
| project id, type, maintenanceConfigurationId = tostring(coalesce(properties.maintenanceConfigurationId, ''))
| where isnotempty(maintenanceConfigurationId)
Please provide below info when asking for support: timestamp = 2024-05-17T09:45:05.8891707Z, correlationId = 84dd3eda-0de6-4a81-9d74-03c29a31884c. (Code:BadRequest) Details: Query is invalid. Please refer to the documentation for the Azure Resource Graph service and fix the error before retrying. (Code:InvalidQuery) ParserFailure (Code:ParserFailure)
Please suggest
Hi @Diptesh Kumar ,
It might just be an issue with case-sensitive "Resources" versus "resources". Try the lower-case "resources" table name.
@Diptesh Kumar I am assuming you want to get the machines which are not attached to any machine configuration, below is the query which you can exute adding the correct values within it and would provide you the results
resources
| where type == 'microsoft.compute/virtualmachines'
| extend vmId = tolower(id)
| join kind=leftouter (
maintenanceresources
| where type == 'microsoft.maintenance/configurationassignments'
| extend resourceId = tolower(properties.resourceId)
| project resourceId
) on $left.vmId == $right.resourceId
| where resourceId == ""
| project vmId