Install VM watch (preview)

You can enable VM watch by using an Azure Resource Manager template (ARM template), PowerShell, or the Azure CLI on Azure virtual machines (VMs) and Azure virtual machine scale sets. You can enable VM watch on both Linux and Windows virtual machines. VM watch is delivered through the Application Health VM extension for ease of adoption.

The code in this article details the steps to install the Application Health VM extension and enable VM watch. Note that the code segments require user input. Any labels within angle brackets (<>) in the code need to be replaced with values that are specific to your installation. Here's a list of parameters with instructions on what to replace them with.

Parameter Description
<your subscription id> The Azure subscription ID in which you want to install VM watch.
<your vm name> The name of the virtual machine to which the extension is being installed.
<your resource group name> The name of the resource group in your Azure subscription that your VM will be assigned to.
<your location> The Azure region in which your VM is installed.
<your extension name The name that will be assigned to the Application Health VM extension that you're installing.
<application health extension type> Specifies whether the Windows or Linux Application Health extension will be installed.
<your vm scale set name> The name of the virtual machine scale set in which you want to install VM watch.

Prerequisites

1. Register the feature

Register for adopting VM watch by running the following commands via the Azure CLI:

az feature register --name VMWatchPreview --namespace Microsoft.Compute --subscription <your subscription id>
az provider register --namespace Microsoft.Compute --subscription <your subscription id>

Validate feature registration

Validate that you successfully registered for the VM watch feature by running the following command:

az feature show --namespace Microsoft.Compute --name VMWatchPreview --subscription <your subscription id>

2. Ensure that a VM is installed

For information on how to create a VM and/or virtual machine scale set, see the quickstart guide for Windows and the quickstart guide for Linux.

Important

If the Application Health extension is already installed on the VM, ensure that the settings autoUpgradeMinorVersion and enableAutomaticUpgrade are set to true.

Install VM watch on an Azure virtual machine

Important

The code segment is identical for both Windows and Linux, except for the value of the parameter <application health extension type> passed in to the extension type. Replace <application health extension type> with "ApplicationHealthLinux" for Linux installations and "ApplicationHealthWindows" for Windows installations.

az vm extension set --resource-group <your resource group> --vm-name <your vm name> --name <application health extension type> --publisher Microsoft.ManagedServices --version 2.0 --settings '{"vmWatchSettings": {"enabled": true}}' --enable-auto-upgrade true 

Validate that the Application Health VM extension is installed on the Azure VM

Go to the Azure portal and confirm that the Application Health VM extension was successfully installed.

The following screenshot shows a Windows installation.

Screenshot that shows a Windows VM installation of the Application Health extension.

The following screenshot shows a Linux installation.

Screenshot that shows a Linux VM installation of the Application Health extension.

To confirm that VM watch was enabled on this VM, go back to the overview page and select the JSON view for the VM. Ensure that the configuration exists in the JSON.

  "settings": {  
      "vmWatchSettings": {  
          "enabled": true  
      }
  }

Install VM watch on an Azure virtual machine scale set

Important

The code segment is identical for both Windows and Linux, except for the value of the parameter <application health extension type> passed in to the extension type. Replace <application health extension type> with "ApplicationHealthLinux" for Linux installations and "ApplicationHealthWindows" for Windows installations.

az vmss extension set --resource-group '<your resource group name>' --vmss-name '<your vm scale set name>' --name <application health extension type> --publisher Microsoft.ManagedServices --version 2.0 --settings '{"vmWatchSettings": {"enabled": true}}' --enable-auto-upgrade true

Validate that the Application Health VM extension is installed in the virtual machine scale set

Go to the Azure portal and confirm that the Application Health VM extension was successfully installed.

The following screenshot shows a Windows installation.

Screenshot that shows installation of the Application Health extension in a Windows virtual machine scale set.

The following screenshot shows a Linux installation.

Screenshot that shows installation of the Application Health extension in a Linux virtual machine scale set.


To confirm that VM watch was enabled on this scale set, go back to the overview page and select the JSON view for the scale set. Ensure that the configuration exists in the JSON.

  "settings": {  
      "vmWatchSettings": {  
          "enabled": true  
      }
  }