I would go for Custom Events and Event Triggers. Since I don't have enough information, I am assuming the following :
First, make sure you have the Event Hub properly set up and that it's receiving the events with the necessary parameters.
You can create a custom event trigger to monitor the Azure Event Hub.
Inside the custom event trigger, you'll need to parse the event data to extract the scheduling parameters and any other information you need for the pipeline.
Using the extracted parameters, you can programmatically schedule the pipeline execution. This can be done using the ADF SDK or REST API, depending on your preferences and requirements.
Now, make sure the trigger you created is associated with the desired pipeline, so it will execute the pipeline with the parameters you extracted.
I recommend implementing error handling and logging to ensure that you can monitor and troubleshoot the system.
I am attaching this code (from an old lab I worked on using the ADF SDK):
from azure.identity import DefaultAzureCredential
from azure.mgmt.datafactory import DataFactoryManagementClient
from azure.mgmt.datafactory.models import *
resource_group_name = 'your-resource-group'
data_factory_name = 'your-data-factory'
pipeline_name = 'your-pipeline'
location = 'your-location'
# Authenticate using the DefaultAzureCredential
credential = DefaultAzureCredential()
adf_client = DataFactoryManagementClient(credential, 'your-subscription-id')
# Define the event trigger
event_trigger = EventTrigger(
description="Trigger based on custom event",
pipeline={
'pipeline_reference': PipelineReference(pipeline_name)
},
type="EventTriggerSource",
events=["your-event-hub-event"],
scope="/subscriptions/your-subscription-id/resourceGroups/your-resource-group",
)
# Create the trigger
adf_client.triggers.create_or_update(resource_group_name, data_factory_name, 'your-trigger-name', event_trigger)
# TODO: Add logic to parse the event data and schedule the pipeline accordingly
You can check the documentation as well Azure Data Factory documentation.