Azure Patching report automation

Siva 736 Reputation points
2026-11-20T21:49:04.8733333+00:00

Hi Team,

How i can get the azure aum patching status, server and its kb installed detail in the email report.

Azure Update Manager
Azure Update Manager

An Azure service to centrally manages updates and compliance at scale.

0 comments No comments

1 answer

Sort by: Newest
  1. AI answer

    2026-11-20T21:50:35.1433333+00:00

    Use an Azure Logic App to query Azure Update Manager’s patchinstallationresources data in Azure Resource Graph, format the machine/run summary and per-update KB records, and email the resulting report.

    1. Validate the reporting queries

    In Azure portal → Resource Graph Explorer, set the scope to the required subscriptions and run these queries.

    Machine-level patch status and counts:

    patchinstallationresources
    | where type !has "softwarepatches"
    | extend p = parse_json(properties)
    | extend Time = todatetime(p.lastModifiedDateTime),
             Machine = tostring(split(id, "/", 8)),
             Status = tostring(p.status),
             Installed = toint(p.installedPatchCount),
             Failed = toint(p.failedPatchCount),
             Pending = toint(p.pendingPatchCount),
             Excluded = toint(p.excludedPatchCount),
             NotSelected = toint(p.notSelectedPatchCount)
    | where Time > ago(7d)
    | project Time, Machine, resourceGroup, Status,
              Installed, Failed, Pending, Excluded, NotSelected
    | order by Time desc
    

    Windows KB-level installation details:

    patchinstallationresources
    | where type has "softwarepatches"
    | where isnull(properties.version)
    | extend p = parse_json(properties)
    | extend Time = todatetime(p.lastModifiedDateTime),
             Machine = tostring(split(id, "/", 8)),
             RunID = tostring(split(id, "/", 10)),
             Patch = tostring(p.patchName),
             KB = tostring(p.kbId),
             Classification = tostring(p.classifications),
             State = tostring(p.installationState)
    | where Time > ago(7d)
    | project Time, RunID, Machine, resourceGroup,
              Patch, KB, Classification, State
    | order by Time desc
    

    These are adapted from Microsoft’s documented machine-summary and Windows installation-detail queries.^1^

    For Linux, replace the Windows query with the documented Linux pattern and report version rather than kbId; KB IDs apply to Windows Server, while Linux records use package versions.^2^

    2. Create the Logic App

    1. In Azure portal, select Logic Apps → Add.
    2. Create either a Consumption or Standard workflow.
    3. Open Identity → System assigned, set Status to On, and select Save.
    4. Assign that identity access at every subscription or resource-group scope included in the report.
      • The account creating the role assignment must itself have permission to create role assignments.
      • Test the identity against all intended subscriptions before scheduling the report.
    5. Add a Recurrence trigger and select the report frequency, such as the morning after patching. Logic Apps supports recurring workflows for periodic queries and notifications.^3^
    6. Configure the workflow to execute each Resource Graph query using its managed identity. Microsoft provides the supported Logic App pattern for periodically calling Resource Graph and assigning access to the workflow identity.^4^
    7. For each query result:
      • Add Data Operations → Parse JSON if the query action returns an untyped JSON body.
      • Select the returned Resource Graph rows array.
      • Add Data Operations → Create HTML table for an email-body report, or Create CSV table for an attachment.
    8. Add Office 365 Outlook → Send an email (V2):
      • To: report recipients
      • Subject: Azure Update Manager patch report
      • Body: output from Create HTML table
      • For CSV, add Attachments, use a name such as AUM-PatchReport.csv, and select the CSV output as attachment content. The Outlook action supports both dynamic body content and attachments.^5^
    9. Save the workflow, select Run Trigger, and verify Runs history, the row count, and the received email.

    For large estates, compare the returned row count with Resource Graph Explorer and implement result paging in the query action if its response indicates additional pages; otherwise, a report can silently omit records. The supplied documentation does not expose the complete request/pagination configuration in the available excerpt, so use the Resource Graph Logic App tutorial’s current workflow definition rather than hard-coding an undocumented endpoint or API version.

    3. Send immediately after scheduled patching

    Instead of a fixed recurrence, attach the workflow as an Azure Update Manager post-event for the maintenance configuration. Update Manager uses Event Grid for pre/post events and supports Logic Apps, Azure Functions, webhooks, and Automation runbooks as handlers. A post-event runs after update installation and can generate a patch summary or report.^6^

    Configure this from the scheduled maintenance configuration’s Events area, create the post-event subscription, and select the Logic App/Event Grid handler exposed by the portal. Keep the scheduled Logic App as a fallback if the report must arrive at a fixed time.

    Reporting limitation

    This produces the Azure Update Manager installation history, not a permanent inventory of every KB ever installed on the operating system. Resource Graph retains pending assessment data for 7 days and installation results for 30 days.^7^

    If a complete or long-term installed-KB inventory is required, collect it separately from each Windows machine and store it in a durable reporting repository. Also export AUM results before the 30-day limit if longer retention is required.^8^


    References

    1. Sample Azure Resource Graph queries to access Azure Update Manager operations data
    2. Access Azure Update Manager operations data using Azure Resource Graph
    3. Tutorial: Create schedule-based automated workflows by using Azure Logic Apps
    4. Tutorial: Run Azure Resource Graph Queries in an Azure Logic App
    5. Connect to Log Analytics or Application Insights from workflows in Azure Logic Apps
    6. About pre and post events
    7. How Update Manager works
    8. Scalable Windows virtual machine patch management
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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