Is there resource graph query we can use which would trigger Alert if machine is not available in Maintenance configuration.

Varma 1,385 Reputation points
2024-05-14T05:12:54.61+00:00

Is there resource graph query we can use which would trigger Alert if machine is not available in Mainteance configuration. If yes could you please share.

Azure Update Manager
Azure Update Manager
An Azure service to centrally manages updates and compliance at scale.
315 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sohail Ali 320 Reputation points Microsoft Employee
    2024-05-28T07:20:20.79+00:00

    Hello Varma,
    The following will help you to trigger the alert when machine is not available in maintenance configuration and if there is no dynamic group is present.

    Please use the query and modify accordingly

    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

     


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.