Share via

Can we fetch the Log Analytics Workspace in use for changetracking for Azure VMS.

harsh sharma 0 Reputation points Microsoft External Staff
2024-09-03T17:43:06.0666667+00:00

I am looking for KQL query to fetch the Log Analytics Workspace that is in use for change tracking for Azure VMS. As MMA's are not supported anymore, so migrating all my alerting to AMA.

Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

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: Most helpful
  1. Sina Salam 28,606 Reputation points Volunteer Moderator
    2024-09-03T20:15:39.0933333+00:00

    Hello harshmickey999,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are in need of KQL query to fetch the Log Analytics Workspace in use for change tracking for Azure VMS.

    The following Kusto Query Language (KQL) query should be helpful to fetch the Log Analytics Workspace in use for change tracking for Azure VMs.

    // Query to find Log Analytics Workspace for change tracking
    Resources
    | where type == "microsoft.operationalinsights/workspaces"
    | join kind=inner (
        ResourceContainers
        | where type == "microsoft.compute/virtualmachines"
    ) on subscriptionId
    | project workspaceName = name, vmName = ResourceContainers.name
    

    For more reading and specific VM resources utilization examples: https://www.geeksforgeeks.org/microsoft-azure-track-cpu-utilization-of-a-azure-virtual-machines-using-kql-log-query and https://curatedsql.com/2020/12/28/retrieving-azure-log-analytics-data-using-azure-data-factory/

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.

    ** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.

    Best Regards,

    Sina Salam

    0 comments No comments

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.