Trigger Microsoft Fabric Data Pipeline using Power Automate
Microsoft Fabric Data Pipelines can be scheduled to happen at regular times. What happens when you want trigger a Microsoft Fabric data pipeline to run as a reaction to an event? For example someone pressing a button in an app. For this we can use Power Automate to start a pipeline using a http request.
Workspace and Pipeline GUIDs
The flow is going to use a http action that uses a URL that includes GUIDs for both the workspace and the data pipeline. Open the data pipeline that will be triggered. Look at the URL in the browser. The Workspace GUID is the string after /groups/ and the data pipeline GUID is the string after /pipelines/.
Start Flow and Add Variables
Now we have the required GUIDS we can start writing the flow. For this example we are going to use a manually triggered flow. Then we add an actions to initialise variables WorkspaceID and PipelineID and select Type of string and put in the values from the previous step.
URL of the Trigger Microsoft Fabric Data Pipeline request
Next I recommend you use a compose step to calculate the URL for the HTTP call. Interestingly the api uses workspaces rather than groups. Make sure you have the corrects /s and no spaces between. If you have called your variables WorkspaceID and PipelineID you can just copy the code below into a Compose action.
https://api.fabric.microsoft.com/v1/workspaces/@{variables('WorkspaceID')}/items/@{variables('PipelineID')}/jobs/instances?jobType=Pipeline
HTTP Request
For this action we are going to use HTTP with Microsoft Entra ID (preauthorized) connection’s Invoke an HTTP request action. Search for HTTP and scroll down till you find it.
If this is the first time you’ve used this action you will need to setup the connection to connect to this api you will need to set it up. The two urls required are as follows
https://onelake.dfs.fabric.microsoft.com/
https://storage.azure.com/
Once you have the connection sorted you can enter in the details of the request. The Method is POST and the Url of the request is the output from the compose step.
Testing Trigger Microsoft Fabric Data Pipeline Flow
The flow requires no inputs so can just be run. When the flow runs it appears to fail, but if you check the data pipeline run history you will see it was triggered just fine.
If you look in the documentation found at https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api#run-on-demand-item-job. There is a note that says “There is no body returned currently”. Eventually it will return the job id of the pipeline run, so I am guessing because that is not returned Power Automate assumes it failed.
Conclusion
Data pipelines are the orchestration tool of Microsoft Fabric so being able to connect it to the Power Platform orchestration tool makes perfect sense. I look forward to the day I can mark this post as redundant and there is a Power Automate connector with an obvious action for this.
Hi,
I just found out your post and I though I finally got the answer on how to run a pipeline from Logic App.
Great explanation overall and step by step process.
I think there is an issue with how to connect to Fabric API: HTTP Request.
The hyperlink redirect to onelake and blob storage rather than MS Fabric API?
I’ve tried to use instead the following, but it failed.
Base ressource URL: https://api.fabric.microsoft.com/v1
Ressource URI: https://analysis.windows.net/powerbi/api
Any suggestions?
Thanks, have been trying to workout this from last few days, looks like you got it to work. I am getting below error in preauth step. BaseResourceUri (https://onelake.dfs.fabric.microsoft.com/) must be a base of the full url (https://api.fabric.microsoft.com/v1/workspaces/XXXX/items/yyyyy/jobs/instances?jobType=Pipeline).
have you encountered this error
Is there a way to do this without using the premium power automate connector ‘invoke a http request’?
How do you setup the connection to the API? I have registered an application on Entra ID and tried to create this application, but it seems to not be working. Thanks!
Hi Laura
I tried creating this as a Logic App in Azure, and the setting up of the ‘HTTP with Microsoft Entra ID (preauthorized)’ worked fine, but at runtime I get;
BaseResourceUri (https://onelake.dfs.fabric.microsoft.com/) must be a base of the full url (https://api.fabric.microsoft.com/v1/workspaces/(workspace id redacted)/items/(pipeline id redacted)/jobs/instances?jobType=Pipeline).
What made you choose the URLs for the connector?
I tried a few alternatives I could think of, but the best I got was ‘InvalidToken’, ‘Access token is invalid’.