Is there any alternative way for trigger in Azure Data Factory?

Viewed 98

I am trying to run the pipeline in azure data factory without using trigger. So Is there any service which we can use instead of trigger in Azure?

2 Answers

Assuming you mean without using the Trigger definitions inside Data Factory, then yes there are other options. The two that I use almost exclusively are 1) Logic Apps and 2) the Azure Data Factory SDK (this document may also be useful). I use a Function App to house my SDK code, and in most cases I have Logic Apps call the AF instead of executing the pipeline directly.

NOTE: purely for pedantic purposes, every pipeline run has a Trigger. When you execute by using the Trigger Now feature inside the workspace or execute a pipeline externally using one of the above methods, the Trigger Type will show as "Manual" in the Monitor section.

In ADF, every pipeline will be executed by manual or by trigger.

The alternative way to ADF triggers can be done by following.

  1. By Powershell.
  2. Logic app.
  3. Using REST API.

By Powershell:

Use Invoke-AzureRmDataFactoryV2Pipeline or Invoke-AzDataFactoryV2Pipeline in Powershell.

Command:

Invoke-AzureRmDataFactoryV2Pipeline -ResourceGroupName "RG name" -DataFactoryName "rakeshdfactory" -PipelineName "MyADFpipeline"

You will get the Pipeline run id in Powershell after executing and you can see the pipeline run in Monitor pipelines-> Trigger runs of ADF.

enter image description here

enter image description here

Schedule this Powershell script using Azure Automation to execute the pipeline daily.

Reference:

Third party tutorial to learn about powershell automation from sharepointdairy by Salaudeen Rajack

Using Logic apps:

ADF event triggers are only permitted to storage accounts, but logic apps can give other options like SQL tables as well.

Here I have created a blob trigger for the logic app. You can create Recurrence trigger for the logic app instead of blob trigger, by which you can schedule the logic app to invoke the ADF pipeline.

enter image description here

enter image description here

Reference:

Article by MITCHELL PEARSON

Related