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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply

Call Fabric data pipelines using notebooks via API's

Hi Community!
Greetings!

 

I am currently working on an interesting solution for which I need to call pipelines via Rest API, i see there are already many questions posted on this on community regarding the topic. However, none of them talks about the steps or way to generate access token. I would like to know how to generate access token using Azure AD as service principle authentication is not supported for this API call.

 

Reference: https://learn.microsoft.com/en-us/rest/api/fabric/core/job-scheduler/run-on-demand-item-job 

 

I request your assistance here.

 

Thanks in advance!

1 ACCEPTED SOLUTION
spencer_sa
Super User
Super User

1) Easiest way of calling the Fabric APIs from within a Fabric notebook is to use semantic-link-labs (aka sempy) and create an instance of FabricRESTClient, which uses the credentials of the logged in user to run the API
https://fabric.guru/using-fabricrestclient-to-make-fabric-rest-api-calls 

 

2) If you really want to generate an access token yourself there are 2-3 ways.  Firstly you can  use the msal python library
https://learn.microsoft.com/en-us/entra/msal/python/

3) Secondly you can craft your token request using the azure identities libraries
https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/identity/access-tokens?ta...

 

4) Lastly you can try to use the requests library (although tbh I've only ever got these working with service principals, which as you note won't kick a pipeline off.

If this helps, please Accept as a Solution to help others find it more easily.

View solution in original post

2 REPLIES 2

Hi @spencer_sa 

 

Much appreciated, since I had to automate this process with scheduling notebook. Fabric Rest Client worked for me. (Apparently idk if it uses the users stored credential as for testing I closed my Fabric window and it still worked.)

 

The other options however cannot be automated as there will either be a login page(like msal) and import requests definitely didn't work as it is specific to service principals.

 

Hope this helps for anyone else looking! 

spencer_sa
Super User
Super User

1) Easiest way of calling the Fabric APIs from within a Fabric notebook is to use semantic-link-labs (aka sempy) and create an instance of FabricRESTClient, which uses the credentials of the logged in user to run the API
https://fabric.guru/using-fabricrestclient-to-make-fabric-rest-api-calls 

 

2) If you really want to generate an access token yourself there are 2-3 ways.  Firstly you can  use the msal python library
https://learn.microsoft.com/en-us/entra/msal/python/

3) Secondly you can craft your token request using the azure identities libraries
https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/identity/access-tokens?ta...

 

4) Lastly you can try to use the requests library (although tbh I've only ever got these working with service principals, which as you note won't kick a pipeline off.

If this helps, please Accept as a Solution to help others find it more easily.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Fabric Update Carousel

Fabric Monthly Update - October 2025

Check out the October 2025 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.