Documentation forServer & 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.

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
  • If Monitor entities by tags is chosen as the Resources Monitoring Method for your Azure cloud account but no tags are specified, then all entities will be monitored.

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.