
Azure Trigger
CertifiedTrigger flows from Azure Monitor metrics
Azure Trigger
Trigger flows from Azure Monitor metrics
Polls Azure Monitor metrics on a schedule and starts an execution when the query returns datapoints. Interval defaults to 60s. Requires regional endpoint.
type: io.kestra.plugin.azure.monitoring.TriggerExamples
Trigger when Azure Monitor metric query returns non-empty results
id: azure_monitor_trigger
namespace: company.team
tasks:
- id: each
type: io.kestra.plugin.core.flow.Loop
values: "{{ trigger.results }}"
tasks:
- id: log
type: io.kestra.plugin.core.log.Log
message: "Datapoint: {{ fromJson(item.value) }}"
triggers:
- id: watch
type: io.kestra.plugin.azure.monitoring.Trigger
interval: "PT1M"
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
endpoint: "https://westeurope.metrics.monitor.azure.com"
resourceIds:
- "/subscriptions/xxx/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/vm1"
metricNames:
- "Percentage CPU"
metricsNamespace: "Microsoft.Compute/virtualMachines"
window: PT5M
aggregations:
- "Average"
Trigger when CPU exceeds threshold with filter
id: azure_monitor_cpu_alert
namespace: company.team
tasks:
- id: alert
type: io.kestra.plugin.core.log.Log
message: "High CPU detected: {{ trigger.datapoints }} datapoints"
triggers:
- id: watch_cpu
type: io.kestra.plugin.azure.monitoring.Trigger
interval: "PT5M"
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
endpoint: "https://westeurope.metrics.monitor.azure.com"
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"
filter: "Average gt 80"
Properties
endpoint *Requiredstring
Azure Monitor endpoint
aggregations array
Aggregations to apply
allowConcurrent Non-dynamicboolean
falseSpecifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.
clientId string
Azure client id
clientSecret string
Azure client secret
filter string
Filter expression
granularity string
Granularity of the returned metrics
interval Non-dynamicstring
PT1MdurationInterval between polling.
The interval between 2 different polls of schedule, this can avoid to overload the remote system with too many calls. For most of the triggers that depend on external systems, a minimal interval must be at least PT30S. See ISO_8601 Durations for more information of available interval values.
metricNames array
Metric names to query
metricsNamespace string
Metrics namespace
orderBy string
Order by expression
resourceIds array
Resource ids to query metrics for
rollupBy string
Dimension to roll up by
stopAfter Non-dynamicarray
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTEDList of execution states after which a trigger should be stopped (a.k.a. disabled).
subscriptionId string
Azure subscription id
tenantId string
Azure tenant id
top integerstring
Maximum number of records to return
when string
trueA condition that determines whether the trigger should run.
A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.
window string
PT5MTime window to query over
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