Microsoft Azure Service Bus Queue Trigger

The Microsoft Azure Service Bus Queue trigger enables you to monitor Azure Service Bus queues for new messages and trigger DAG runs when messages arrive.

Authenticating to Azure

The trigger uses the connection you have configured in Airflow to connect to Azure. Please refer to the Microsoft Azure Service Bus documentation for details on how to configure your connection.

Using the Trigger

This example shows how to use the AzureServiceBusQueueTrigger.

from airflow.providers.microsoft.azure.triggers.message_bus import AzureServiceBusQueueTrigger

trigger = AzureServiceBusQueueTrigger(
    queues=["my_queue"],
    azure_service_bus_conn_id="azure_service_bus_default",
    max_message_count=1,
    poll_interval=5.0,
)

# The trigger will fire when a message is available in the queue.

Microsoft Azure Service Bus Subscription Trigger

The Microsoft Azure Service Bus Subscription trigger enables you to monitor Azure Service Bus topic subscriptions for new messages and trigger DAG runs when messages arrive.

Authenticating to Azure

The trigger uses the connection you have configured in Airflow to connect to Azure. Please refer to the Microsoft Azure Service Bus documentation for details on how to configure your connection.

Using the Trigger

This example shows how to use the AzureServiceBusSubscriptionTrigger.

from airflow.providers.microsoft.azure.triggers.message_bus import AzureServiceBusSubscriptionTrigger

trigger = AzureServiceBusSubscriptionTrigger(
    topics=["my_topic"],
    subscription_name="my_subscription",
    azure_service_bus_conn_id="azure_service_bus_default",
    max_message_count=1,
    poll_interval=5.0,
)

# The trigger will fire when a message is available in the topic subscription.

Azure Service Bus Message Queue

Azure Service Bus Queue Provider

Implemented by AzureServiceBusQueueTrigger

The Azure Service Bus Queue Provider is a message queue provider that uses Azure Service Bus queues. It allows you to monitor Azure Service Bus queues for new messages and trigger DAG runs when messages arrive.

Azure Service Bus Subscription Provider

Implemented by AzureServiceBusSubscriptionTrigger

The Azure Service Bus Subscription Provider is a message queue provider that uses Azure Service Bus topic subscriptions. It allows you to monitor Azure Service Bus topic subscriptions for new messages and trigger DAG runs when messages arrive.

Was this entry helpful?