Any possibilities to monitor VM hung status

Sky High 311 Reputation points

Hi MS,

Is there a way to monitor Azure VM hung status from Azure monitoring or using log analytics? Please suggest.

What are the logs that can be viewed using log analytics from a VM perspective.

Any application based logs be able to capture running on Azure VM?


Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,785 questions
Azure Analysis Services
Azure Analysis Services
An Azure service that provides an enterprise-grade analytics engine.
436 questions
Azure Virtual Desktop
Azure Virtual Desktop
A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
1,353 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Andrew Blumhardt 9,491 Reputation points Microsoft Employee

    Any of the tables where the VM is expected to write logs regularly can be used. For example event, perf, heartbeat, etc. You would see a drop in data collection when the system is hung or offline.

    | summarize arg_max(TimeGenerated, *) by Computer
    | where TimeGenerated < ago(15m)

    1 person found this answer helpful.
    0 comments No comments

  2. Maxim Sergeev 6,566 Reputation points Microsoft Employee

    Typically, if the VM is hung, agents are hung too. Per @Andrew Blumhardt is suggested the query, its required to install Azure Monitoring Agent first (which is basically recommended for many other monitoring scenarios).
    This is an instruction how to install the Azure Monitoring Agent

    Then you will be able to query data as @Andrew Blumhardt suggested to get alerted if something goes wrong with the virtual machine.
    Additionally, if you are interested to monitor availability of the virtual machine from Azure Fabric, you can use the new availability metric (preview) and get notified is the machine is down.


    1 person found this answer helpful.
    0 comments No comments

  3. Amol Shelar 401 Reputation points

    @Sky High

    When you enable monitoring with VM insights in Azure Monitor for the virtual machine, a heartbeat is sent to Azure Monitor every minute. You can create a log query alert rule that sends an alert if a heartbeat isn't detected. This method not only alerts if the virtual machine isn't running, but also if it's not responsive.

    You can follow below steps,

    1. You can create alert when the Azure VM is unavailable due to any reason.
      To achieve this you need to first enable monitoring for Azure virtual machine.
      Refer tutorial-monitor-vm-enable

    1. Create a Heartbeat Query using Logs Events tab.
    2. Create a New Alert Rule
    3. Configure the action group such as sending an email or an SMS whenever the server is unavailable.

    For complete detail, refer below link,

    -Please mark it as Answer if it helps to resolve your query-


    1 person found this answer helpful.

  4. Rishabh mishra 156 Reputation points

    You can use boot diagnostics feature Located in the virtual machine blade, the boot diagnostics option is under the Support and Troubleshooting section in the Azure portal. Selecting boot diagnostics will display a screenshot and serial log information. The serial log contains kernel messaging and the screenshot is a snapshot of your VMs current state

    0 comments No comments