'How to know weather ADF pipeline is in queue dynamically

Each pipeline instance is running every one hour.

If my pipeline is in the queue I want to set an alert mail.

How to know whether ADF pipeline is in queue dynamically



Solution 1:[1]

How to know whether ADF pipeline is in queue dynamically

A pipeline run has different status during its lifecycle, the possible values of run status are listed below:

• Queued

• InProgress

• Succeeded

• Failed

• Canceling

• Cancelled

To monitor the pipeline run, add the following code:

# Monitor the pipeline run
time.sleep(30)
pipeline_run = adf_client.pipeline_runs.get(
    rg_name, df_name, run_response.run_id)
print("\n\tPipeline run status: {}".format(pipeline_run.status))
filter_params = RunFilterParameters(
    last_updated_after=datetime.now() - timedelta(1), last_updated_before=datetime.now() + timedelta(1))
query_response = adf_client.activity_runs.query_by_pipeline_run(
    rg_name, df_name, pipeline_run.run_id, filter_params)
print_activity_run_details(query_response.value[0])

You can get status using status parameter. For more information follow this document.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AbhishekKhandave-MT