Azure Monitor Metrics Batch API

Operations for batch querying Azure Monitor metrics across multiple resources

Operations 1

POST /subscriptions/{subscriptionId}/metrics:batchGet Azure Monitor Batch query metrics for multiple resources #

Documentation

📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/metrics
📖
Authentication
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/rest-api-walkthrough
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/rest-api-walkthrough
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/metric-definitions
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/metrics-batch
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/loganalytics/
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/overview
📖
Documentation
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/logs-ingestion-api-overview
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/tutorial-logs-ingestion-api
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/alertrules
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/scheduledqueryrule-2021-08-01/scheduled-query-rules
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/action-groups
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/autoscale-settings
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/autoscale/autoscale-best-practices
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/application-insights/
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-enable
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/diagnostic-settings
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/diagnostic-settings
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/activity-logs
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-rules
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/data-collection/data-collection-rule-create-edit
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/data-collection-endpoints
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/data-collection/data-collection-endpoint-overview
📖
Documentation
https://learn.microsoft.com/en-us/rest/api/monitor/private-link-scopes
📖
GettingStarted
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/private-link-configure

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/microsoft-azure-monitor-metrics-batch-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

microsoft-azure-monitor-metrics-batch-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Azure Monitor Metrics Batch API
  description: A high-volume API designed for retrieving metric values across multiple Azure resources in a single request. All resources in a batch must be in the same subscription and region.
  version: '2024-02-01'
  contact:
    name: Microsoft Azure Support
    url: https://azure.microsoft.com/en-us/support/options/
  license:
    name: Microsoft API License
    url: https://azure.microsoft.com/en-us/support/legal/
servers:
- url: https://{region}.metrics.monitor.azure.com
  description: Azure Monitor Metrics regional endpoint
  variables:
    region:
      default: eastus
      description: The Azure region for the metrics endpoint.
security:
- oauth2:
  - https://management.azure.com/.default
tags:
- name: Metrics Batch
  description: Operations for batch querying Azure Monitor metrics across multiple resources
paths:
  /subscriptions/{subscriptionId}/metrics:batchGet:
    post:
      operationId: MetricsBatch_Batch
      summary: Azure Monitor Batch query metrics for multiple resources
      description: Lists the metric values for multiple resources in a single batch request. All resources must be in the same subscription, region, and resource type. Allows for efficient retrieval of metric data at scale.
      tags:
      - Metrics Batch
      parameters:
      - $ref: '#/components/parameters/SubscriptionIdParameter'
      - $ref: '#/components/parameters/ApiVersionParameter'
      - $ref: '#/components/parameters/StartTimeParameter'
      - $ref: '#/components/parameters/EndTimeParameter'
      - $ref: '#/components/parameters/IntervalParameter'
      - $ref: '#/components/parameters/MetricNamesParameter'
      - $ref: '#/components/parameters/MetricNamespaceParameter'
      - $ref: '#/components/parameters/AggregationParameter'
      - $ref: '#/components/parameters/TopParameter'
      - $ref: '#/components/parameters/OrderByParameter'
      - $ref: '#/components/parameters/FilterParameter'
      - $ref: '#/components/parameters/RollUpByParameter'
      requestBody:
        description: The batch body that contains the list of resource IDs to query metrics for.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetricsBatchRequest'
      responses:
        '200':
          description: Successful batch request to get metrics for multiple resources.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricsBatchResponse'
        default:
          description: Error response describing why the operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code.
        message:
          type: string
          description: Error message indicating why the operation failed.
    TimeSeriesElement:
      type: object
      properties:
        metadatavalues:
          type: array
          items:
            type: object
            properties:
              name:
                type: object
                properties:
                  value:
                    type: string
                  localizedValue:
                    type: string
              value:
                type: string
          description: The metadata values returned.
        data:
          type: array
          items:
            $ref: '#/components/schemas/MetricValue'
          description: An array of data points representing the metric values.
    MetricResultsResponse:
      type: object
      properties:
        starttime:
          type: string
          description: The start time, in datetime format, for which the data was retrieved.
        endtime:
          type: string
          description: The end time, in datetime format, for which the data was retrieved.
        interval:
          type: string
          description: The interval (window size) for which the metric data was returned.
        namespace:
          type: string
          description: The namespace of the metrics being queried.
        resourceregion:
          type: string
          description: The region of the resource being queried for metrics.
        resourceid:
          type: string
          description: The resource ID for which metrics were retrieved.
        value:
          type: array
          items:
            $ref: '#/components/schemas/Metric'
          description: The value of the collection.
    Metric:
      type: object
      required:
      - id
      - type
      - name
      - unit
      - timeseries
      properties:
        id:
          type: string
          description: The metric ID.
        type:
          type: string
          description: The resource type of the metric resource.
        name:
          type: object
          properties:
            value:
              type: string
              description: The invariant value.
            localizedValue:
              type: string
              description: The display name.
          required:
          - value
        displayDescription:
          type: string
          description: Detailed description of this metric.
        unit:
          type: string
          enum:
          - Count
          - Bytes
          - Seconds
          - CountPerSecond
          - BytesPerSecond
          - Percent
          - MilliSeconds
          - ByteSeconds
          - Unspecified
          - Cores
          - MilliCores
          - NanoCores
          - BitsPerSecond
          description: The unit of the metric.
        timeseries:
          type: array
          items:
            $ref: '#/components/schemas/TimeSeriesElement'
          description: The time series returned when a data query is performed.
    MetricValue:
      type: object
      required:
      - timeStamp
      properties:
        timeStamp:
          type: string
          format: date-time
          description: The timestamp for the metric value in ISO 8601 format.
        average:
          type: number
          format: double
          description: The average value in the time range.
        minimum:
          type: number
          format: double
          description: The least value in the time range.
        maximum:
          type: number
          format: double
          description: The greatest value in the time range.
        total:
          type: number
          format: double
          description: The sum of all of the values in the time range.
        count:
          type: number
          format: double
          description: The number of samples in the time range.
    MetricsBatchResponse:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: '#/components/schemas/MetricResultsResponse'
          description: The collection of metric results for each resource.
    MetricsBatchRequest:
      type: object
      required:
      - resourceids
      properties:
        resourceids:
          type: array
          items:
            type: string
          description: The list of resource IDs to query metrics for. All resources must be in the same subscription, region, and resource type.
  parameters:
    SubscriptionIdParameter:
      name: subscriptionId
      in: path
      required: true
      description: The ID of the target subscription.
      schema:
        type: string
    OrderByParameter:
      name: orderBy
      in: query
      required: false
      description: The aggregation to use for sorting results and the direction of the sort.
      schema:
        type: string
    IntervalParameter:
      name: interval
      in: query
      required: false
      description: The interval (window size) of the query in ISO 8601 duration format.
      schema:
        type: string
        default: PT1M
    MetricNamesParameter:
      name: metricnames
      in: query
      required: true
      description: The names of the metrics (comma-separated) to retrieve.
      schema:
        type: string
    RollUpByParameter:
      name: rollUpBy
      in: query
      required: false
      description: Dimension name(s) to rollup results by.
      schema:
        type: string
    ApiVersionParameter:
      name: api-version
      in: query
      required: true
      description: Client API version.
      schema:
        type: string
        default: '2024-02-01'
    MetricNamespaceParameter:
      name: metricNamespace
      in: query
      required: true
      description: Metric namespace that contains the requested metric names.
      schema:
        type: string
    TopParameter:
      name: top
      in: query
      required: false
      description: The maximum number of records to retrieve per resource.
      schema:
        type: integer
        format: int32
    StartTimeParameter:
      name: starttime
      in: query
      required: true
      description: The start time of the query in ISO 8601 format.
      schema:
        type: string
        format: date-time
    FilterParameter:
      name: $filter
      in: query
      required: false
      description: The $filter used to reduce the set of metric data returned.
      schema:
        type: string
    AggregationParameter:
      name: aggregation
      in: query
      required: false
      description: The list of aggregation types (comma-separated) to retrieve.
      schema:
        type: string
    EndTimeParameter:
      name: endtime
      in: query
      required: true
      description: The end time of the query in ISO 8601 format.
      schema:
        type: string
        format: date-time
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
          scopes:
            https://management.azure.com/.default: Access Azure Management API