
Azure Query
CertifiedQuery metrics from Azure Monitor
Azure Query
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.
type: io.kestra.plugin.azure.monitoring.QueryExamples
Query CPU utilization from Azure Monitor for multiple VMs
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
endpoint *Requiredstring
Azure Monitor regional endpoint
Regional metrics endpoint, e.g. https://westeurope.metrics.monitor.azure.com
metricNames *Requiredarray
Metric names
Metrics to retrieve for the specified resources
metricsNamespace *Requiredstring
Metrics namespace
Namespace for the metrics, e.g., Microsoft.Compute/virtualMachines
resourceIds *Requiredarray
Resource IDs
List of Azure resource IDs to query
tenantId *Requiredstring
Azure AD tenant ID (GUID)
aggregations array
Aggregations
Aggregation types to include (Average, Total, Maximum, Minimum, Count)
clientId string
Client ID of the Azure AD application
Application (client) ID used for service principal authentication.
clientSecret string
Client secret for the Azure AD application
Secret value associated with the client ID; store in a Kestra secret.
filter string
Filter
OData filter expression for the query
interval string
Time grain
ISO-8601 duration for aggregation granularity, e.g., PT1M
orderBy string
Order by
Sorting clause for results
pemCertificate string
PEM-encoded certificate content for client authentication
PEM text for certificate-based auth; alternative to clientSecret.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
rollupBy string
Rollup by dimension
Dimension name(s) to roll up series (e.g., City)
top integerstring
Top
Limit on number of time series returned
window string
PT5MTime window
Look-back duration ending at now; defaults to PT5M
Outputs
datapoints integer
Total number of datapoints fetched across all metrics and resources
metrics integer
Total number of unique metrics fetched across all resources
resources integer
Total number of resources queried
results array
List of metrics results