Azure Query

Azure Query

Certified

Query metrics from Azure Monitor

Fetches metrics for one or more resource IDs using the regional Metrics endpoint. Supports windowed queries, aggregation, granularity, filters, ordering, and rollups. Defaults window to PT5M.

yaml
type: io.kestra.plugin.azure.monitoring.Query

Query CPU utilization from Azure Monitor for multiple VMs

yaml
id: azure_monitor_query
namespace: company.team
tasks:
  - id: query
    type: io.kestra.plugin.azure.monitoring.Query
    tenantId: "{{ secret('AZURE_TENANT_ID') }}"
    clientId: "{{ secret('AZURE_CLIENT_ID') }}"
    clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
    resourceIds:
      - "/subscriptions/xxx/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm1"
      - "/subscriptions/xxx/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm2"
    metricNames:
      - "Percentage CPU"
    metricsNamespace: "Microsoft.Compute/virtualMachines"
    window: PT5M
    aggregations:
      - "Average"
      - "Maximum"
Properties

Azure Monitor regional endpoint

Regional metrics endpoint, e.g. https://westeurope.metrics.monitor.azure.com

SubTypestring

Metric names

Metrics to retrieve for the specified resources

Metrics namespace

Namespace for the metrics, e.g., Microsoft.Compute/virtualMachines

SubTypestring

Resource IDs

List of Azure resource IDs to query

Azure AD tenant ID (GUID)

SubTypestring

Aggregations

Aggregation types to include (Average, Total, Maximum, Minimum, Count)

Client ID of the Azure AD application

Application (client) ID used for service principal authentication.

Client secret for the Azure AD application

Secret value associated with the client ID; store in a Kestra secret.

Filter

OData filter expression for the query

Time grain

ISO-8601 duration for aggregation granularity, e.g., PT1M

Order by

Sorting clause for results

PEM-encoded certificate content for client authentication

PEM text for certificate-based auth; alternative to clientSecret.

Reference (ref) of the pluginDefaults to apply to this task.

Rollup by dimension

Dimension name(s) to roll up series (e.g., City)

Top

Limit on number of time series returned

DefaultPT5M

Time window

Look-back duration ending at now; defaults to PT5M

Total number of datapoints fetched across all metrics and resources

Total number of unique metrics fetched across all resources

Total number of resources queried

SubTypeobject

List of metrics results