Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
munnas
Regular Visitor

Unable to trigger fabric data pipeline using REST API's

Hi, 

 

I have recently created, microsoft data fabric trail account with 60 day trail.

And under this trail account, I am trying to invoke microsoft data fabric data pipeline using Postman/from some external client.

 

Based on the docuementation(i.e. https://learn.microsoft.com/en-us/fabric/data-factory/pipeline-rest-api#obtain-an-authorization-toke...), I tried to optain the token with below curl:


curl --location 'https://login.microsoftonline.com/tanentId/oauth2/v2.0/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=myclientId' \
--data-urlencode 'client_secret=mysecret' \
--data-urlencode 'scope=https://api.fabric.microsoft.com/.default' \
--data-urlencode 'grant_type=client_credentials'


I get the token, but when i am using the same token to rigger the pipline using below curl. but i get 401 error with message "The caller is not authenticated to access this resource". please help how can i proceed.

 

curl --location --request POST 'https://api.fabric.microsoft.com/v1/workspaces/myworkspaceid/items/mypiplelineid/jobs/instances?jobType=Pipeline' \
--header 'Authorization: Bearer <token>' \
--data ''

 

Thanks.

2 ACCEPTED SOLUTIONS
jwinchell40
Super User
Super User

@munnas - The API that you use to trigger a Fabric Data Pipeline does not support Service Principals.  You have to use a named user account & password.  They will be bringing service pricipal support to more API's in the future.

 

It does work with Username/Password as we are able to do that within our Company.   It will eventually work in Power Automate but since the API does not return a response the HTTP Post with Azure Entra (preauthorized) does not function properly.

 

There is another thread in the community that goes into more detail.  It's fairly recent.

 

Jeremy

View solution in original post

8 REPLIES 8
jwinchell40
Super User
Super User

@munnas - The API that you use to trigger a Fabric Data Pipeline does not support Service Principals.  You have to use a named user account & password.  They will be bringing service pricipal support to more API's in the future.

 

It does work with Username/Password as we are able to do that within our Company.   It will eventually work in Power Automate but since the API does not return a response the HTTP Post with Azure Entra (preauthorized) does not function properly.

 

There is another thread in the community that goes into more detail.  It's fairly recent.

 

Jeremy

@jwinchell40  thanks for the response. could you please some example how you are able to trigger the datapipleline.

@munnas - Sorry for the delay; I will ask our Dev Team to share the snippet from our web app. They are on Holiday; so it may not be until Monday/Tuesday next week.

FabianSchut
Super User
Super User

Did you add the service principal to access the workspace where the data pipeline is in with sufficient permissions? You do not need any application permissions as shown in the screenshot. Also make sure that your service principal is able to run REST APIs. This can be set in the Power BI (Fabric) admin settings.

munnas
Regular Visitor

I have already configured the application under Microsoft Entra ID (https://entra.microsoft.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade).

 

Below is a screenshot showing the application permissions that were added. Since microsoft fabric was not available, I added application permissions for the Power BI service instead.


munnas_0-1729924823742.png

Thanks.

Since microsoft fabric was not available, I added application permissions for the Power BI service instead.

I would call this the "money tree approach". You may want to investigate if there are Fabric specific permissions, either already implemented or planned.

lbendlin
Super User
Super User

Evaluate your token at jwt.io  most likely you have misconfigured the application scope.  Don't use delegated permissions.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.