Azure Log Search API to Grab Information

LaVar Blalock 115 Reputation points
2023-03-24T20:21:10.3366667+00:00

Hello,

Thanks ahead of time for any information you can provide. What I am attempting to do is this. I have a custom query that grabs the heal status of our vm. The in that query results i have the vms information like it if is health or unhealthy so we can start patching.

Is there an API on this that can help grab the project output that says it is health or unhealth. Or do you happen to know a better way of grabbing this infomration?

Azure Analysis Services
Azure Analysis Services
An Azure service that provides an enterprise-grade analytics engine.
456 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,975 questions
Azure AI Metrics Advisor
Azure AI Metrics Advisor
An Azure artificial intelligence analytics service that proactively monitors metrics and diagnoses issues.
83 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
644 questions
{count} votes

Accepted answer
  1. kobulloc-MSFT 26,341 Reputation points Microsoft Employee
    2023-03-25T00:41:27.31+00:00

    Hello, @LaVar Blalock !

    How can I use a REST API to get the health of my VMs?

    You can use the Azure Resource Health API or the Azure Monitor API to look at the health of a VM or other Azure resources. There are two Microsoft Developer blogs that go into this in detail:

    To identify what health criteria are applicable or active on a particular VM, and to get their IDs that are required for other API-related operations, use the following GET API example leveraging ARM client on command prompt shown below.

    "subscriptions/Subscription_Name/resourceGroups/Resource_Group_Name/providers/Microsoft.Compute/virtualMachines/VM_Name/providers/Microsoft.WorkloadMonitor/monitors?api-version=2018-08-31-preview”
    

    GET API example leveraging ARM client on command


0 additional answers

Sort by: Most helpful

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.