How to run a ADF Pipeline using a Power Bi Button
Introduction:
In today’s data-driven world, seamless integration between tools is much needed. Azure Data Factory (ADF) is a cloud-based data integration service that orchestrates and automates ETL processes. The traditional method of triggering a pipeline is done via the Azure portal. This blog dives into an approach that connects Azure Data Factory (ADF) with Power BI, allowing users to trigger ADF pipelines directly from a Power BI button.
Technologies Used:
- Power BI
- Logic App
- Azure Data Factory
Step 1: Create a Button in Power Bi
- Log in to Power BI.
- Add a Button visual, then go to the Actions tab. Turn it On.
- Select “Web URL” in the Type action dropdown.
- Next, copy the HTTP Trigger URL from the Azure Logic App (Step 2) and paste it into the Web URL section.
Kindly refer the above image for reference.
Step 2: Create a Logic App Flow
Next up, Creating a Logic App Flow.
First Action: When a HTTP request is received
Once you start to work on the Flow and Save it, The HTTP URL will be generated which you can use to make the connection between the Power Bi Button and ADF Pipeline.
Method used should be GET.
Reference:
Second Action: Create a pipeline run.
When you use this trigger, at first you need to sign in with your azure account. Post that you will fill the necessary parameter fields.
Fields:
- Subscription Name (Select the Subscription Name)
- Resource Group (Select the Resource Group)
- Data Factory Name (Select Data Factory)
- Data Factory Pipeline Name (Select Pipeline which needs to be triggered)
Reference:
Third Action: Add a Response Action
Add a response action and set the Status Code to 200 and add a text in the Body Section.
Refer:
Additionally, add a parallel branch and add the same Response trigger for the status code 400 and enter a text in the body part, For example: FAILURE
Refer:
Done!! Your Logic App is created now. It will trigger a ADF pipeline.
Here is a sample ARM template for the flow created:
{
"$schema": "
https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#"
,
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
"type": "string",
"defaultValue": "MyLogicApp",
"metadata": {
"description": "Name of the Logic App."
}
}
},
"resources": [
{
"name": "[parameters('logicAppName')]",
"type": "Microsoft.Logic/workflows",
"apiVersion": "2017-07-01",
"location": "[resourceGroup().location]",
"properties": {
"definition": {
"$schema": "
https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#"
,
"actions": {
"Response": {
"inputs": {
"body": "Success",
"statusCode": 200
},
"kind": "Http",
"runAfter": {},
"type": "Response"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"manual": {
"inputs": {
"method": "GET",
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}
}
]
}
Testing Time:
Now you can click on the Button in Power BI, and it will automatically trigger the ADF Pipeline.
Here when the button is clicked.
The pipeline got triggered. Please check your pipeline status in Monitor option in ADF.
Conclusion:
By the use Power BI and Logic App we can successfully triggered the ADF pipeline using the Power BI button. This setup not only saves time by automating data processing workflows but also provides an interactive and user-friendly method for managing pipelines directly from Power BI dashboards.
About Us:
Bi3 has been recognized for being one of the fastest-growing companies in Australia. Our team has delivered substantial and complex projects for some of the largest organizations around the globe, and we’re quickly building a brand that is well-known for superior delivery.
Website: https://bi3technologies.com/
Follow us on,
LinkedIn: https://www.linkedin.com/company/bi3technologies
Instagram: https://www.instagram.com/bi3technologies/
Twitter: https://twitter.com/Bi3Technologies