airflow.providers.microsoft.azure.triggers.compute

Classes

AzureVirtualMachineStateTrigger

Poll the Azure VM power state and yield a TriggerEvent once it matches the target.

Module Contents

class airflow.providers.microsoft.azure.triggers.compute.AzureVirtualMachineStateTrigger(resource_group_name, vm_name, target_state, azure_conn_id='azure_default', poke_interval=30.0)[source]

Bases: airflow.triggers.base.BaseTrigger

Poll the Azure VM power state and yield a TriggerEvent once it matches the target.

Uses the native async Azure SDK client (azure.mgmt.compute.aio) so that the triggerer event loop is never blocked.

Parameters:
  • resource_group_name (str) – Name of the Azure resource group.

  • vm_name (str) – Name of the virtual machine.

  • target_state (str) – Desired power state, e.g. running, deallocated.

  • azure_conn_id (str) – Azure connection id.

  • poke_interval (float) – Polling interval in seconds.

resource_group_name[source]
vm_name[source]
target_state[source]
azure_conn_id = 'azure_default'[source]
poke_interval = 30.0[source]
serialize()[source]

Serialize AzureVirtualMachineStateTrigger arguments and classpath.

async run()[source]

Poll VM power state asynchronously until it matches the target state.

Was this entry helpful?