Add Azure Virtual Machines operators, sensor, and trigger (#49796)#62391
Open
nailo2c wants to merge 8 commits intoapache:mainfrom
Open
Add Azure Virtual Machines operators, sensor, and trigger (#49796)#62391nailo2c wants to merge 8 commits intoapache:mainfrom
nailo2c wants to merge 8 commits intoapache:mainfrom
Conversation
sjyangkevin
reviewed
Feb 24, 2026
providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/compute.py
Outdated
Show resolved
Hide resolved
dabla
reviewed
Feb 24, 2026
Contributor
dabla
left a comment
There was a problem hiding this comment.
Really nice and clean code, great work!
providers/microsoft/azure/src/airflow/providers/microsoft/azure/operators/compute.py
Outdated
Show resolved
Hide resolved
providers/microsoft/azure/src/airflow/providers/microsoft/azure/triggers/compute.py
Outdated
Show resolved
Hide resolved
providers/microsoft/azure/src/airflow/providers/microsoft/azure/triggers/compute.py
Show resolved
Hide resolved
providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/compute.py
Outdated
Show resolved
Hide resolved
providers/microsoft/azure/tests/unit/microsoft/azure/triggers/test_compute.py
Outdated
Show resolved
Hide resolved
…ove connection handling
Contributor
Author
|
Hi, thanks for the review, I learned a lot from it! 😄 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes: #49796
Why
This request is from issue #49796.
ec2andgcesupport these features, so I think it would be great if Azure Virtual Machines also supported them.How
Implemented
hooks,operators,sensors, andtriggersfollowing the same pattern as theec2provider, with deferrable mode support.The whole process is shown in sequence diagram below:
sequenceDiagram participant DAG as DAG participant StartOp as StartOperator participant Sensor as StateSensor participant Trigger as StateTrigger participant Hook as AzureComputeHook participant Azure as Azure Compute API DAG->>StartOp: execute() StartOp->>Hook: start_instance(resource_group, vm_name) Hook->>Azure: begin_start(...) Hook->>Azure: poller.result() (when wait_for_completion=True) StartOp-->>DAG: success DAG->>Sensor: execute() Sensor->>Hook: poke() -> get_power_state() Hook->>Azure: instance_view(...) alt state already reached Sensor-->>DAG: success else state not reached + deferrable=True Sensor-->>Trigger: defer(trigger=AzureVirtualMachineStateTrigger) loop poll until target state Trigger->>Hook: async_get_power_state() [native async] Hook->>Azure: instance_view(...) end Trigger-->>Sensor: TriggerEvent(status=success) Sensor-->>DAG: execute_complete() endWhat
System Test
Doc
Was generative AI tooling used to co-author this PR?
Claude ( I've thoroughly reviewed all AI-generated code :) )
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.