---
sourceDocument: Yokohama IT Operations Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/yokohama/it-operations-management

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama IT Operations Management

ft:clusterId :

    - itom

bundleId :

    - itom

workflow :

    - Technology


---

# Azure metrics script

# Azure metrics script {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

When creating a new policy for Azure cloud metrics, create a .json script to determine the metrics to be monitored. The format for the script appears below, followed by a table explaining the script contents.  

    {
      "namespace": "Microsoft.Network/loadBalancers",
      "metrics": [
              "AllocatedSnatPorts",
              "ByteCount",
              "DipAvailability",
              "PacketCount",
              "SnatConnectionCount",
              "SYNCount",
              "UsedSnatPorts",
              "VipAvailability"
      ],
      "time_grain": "PT1M"
    }

Resources and their metrics are retrievable from the [Supported metrics for Azure resources](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-metrics/microsoft-compute-virtualmachines-metrics) page.
{#azure-metrics-script__table_v1g_1jw_mzb__entry__2}

| Header | Description |
|-|-|
| namespace | The name of the resource being monitored. |
| metrics | The metrics being retrieved from the monitored resource. |
| time_grain | The granularity of how often metrics are to be collected. Possible values are: * PT1M: Metric values are collected every minute. * PT5M: Metric values are collected every 5 minutes. * PT15M: Metric values are collected every 15 minutes. * PT30M: Metric values are collected every 30 minutes. * PT1H: Metric values are collected every hour. * PT1D: Metric values are collected daily. {#azure-metrics-script__ul_nkv_xqw_mzb} |
[ ]

{#azure-metrics-script__table_v1g_1jw_mzb}

