--- title: Azure metrics script description: 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. locale: en-US canonical_url: https://www.servicenow.com/docs/r/it-operations-management/agent-client-collector/azure-metrics-script.html release: brazil product: Agent Client Collector classification: agent-client-collector topic_type: reference last_updated: "2026-09-10" reading_time_minutes: 1 breadcrumb: [ACC-M reference, Agent Client Collector reference, Agent Client Collector, IT Operations Management] --- # Azure metrics script 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.
| 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. |