Documentation forHybrid Cloud Observability Essentialsand Server & Application Monitor

Microsoft Azure Virtual Machine API poller template

Use this SAM API poller template to monitor Microsoft Azure Virtual Machine performance and statistic counters, including performance and statistics counters for CPU, traffic, and disk metrics.

Links and screenshots herein are attributed to © 2021 Microsoft Corp., available at docs.microsoft.com.

Prerequisites

  • Use the following parameters to specify the API endpoint in the request URL:
    • ${SUBSCRIPTION_ID}: Your Azure subscription ID.
    • ${USERGROUP_ID}: A resource group ID
    • ${VM_NAME}: The Virtual Machine name

    Use the following example to help locate values in Azure:

  • Configure OAuth 2.0 Azure credentials with the following values:
    • Scope: https://management.azure.com/.default
    • Access Token URL: https://login.microsoftonline.com/{TENANTID}/oauth2/v2.0/token

      Although "(optional)" appears next to the Scope field in the UI, this value is required for API pollers based on this template.

  • The Virtual Machine has access control to the Application with at least the Reader role.

Notes

  • Data is polled every 2 minutes, by default.
  • Default thresholds are not set for this template.
  • Here is an API request example:
    https://management.azure.com/subscriptions${SUBSCRIPTION_ID}/resourceGroups/myResource/providers/Microsoft.Compute/virtualMachines/AzureMachinePM/providers/microsoft.insights/metrics?interval=PT1H&metricnames=Percentage CPU,Network In Total,Network Out Total,Disk Read Bytes,Disk Write Bytes,Disk Read Operations/Sec,Disk Write Operations/Sec,CPU Credits Remaining,CPU Credits Consumed&aggregation=Average,Total&api-version=2019-07-01

Available metrics

The following metrics are returned, by default:

  • CPU Percentage
  • Network Incoming Traffic
  • Network Outgoing Traffic
  • Disk Read Bytes
  • Disk Write Bytes
  • Disk Read Operations/Sec
  • Disk Write Operations/Sec
  • CPU Credits Remaining
  • CPU Credits Consumed

For reference, see Supported metrics with Azure Monitor.