Forum Discussion
Access or Trigger Pipeline using Fabric Rest API and Token Generation
Hi,
I am trying to run a fabric pipeline using rest api.
For this i created a Microsoft Entra App on azure portal with desired permissions that include workspace readwrite, datapipeline execute and read write. I added the app owner as me. In the fabric portal, i give access 'Service principals can use Fabric APIs'
Then i generate access token with the scope 'https://fabric.microsoft.com/.default' with successfully generated the token. Now when i am trying to use this token in the apis its throws invalid token error.
Intitially i am tring to get pipelines of workspace using this api - https://api.fabric.microsoft.com/v1/workspaces/<WS ID>/dataPipelines
I tried running pipeline as well - https://api.fabric.microsoft.com/v1/workspaces/<WS ID>/items/<Pipeline id>/jobs/instances?jobType=Pipeline
I am attaching all the screenshot. I am really looking for something useful as i tried everything from my side.
No nothing works out. I tried everything shared and worked as per the API document given by Microsoft, but the API did not hit the pipelines. Though I found out an alternative approach to make this feature work . I will share the blog link soon here for others facing the same issue
23 Replies
- lbendlin
Super User
i created a Microsoft Entra App on azure portal with desired permissions that include workspace readwritedid you choose "delegated" permissions?
- ChristinaODTFrequent Visitor
Yes it is delegated but i tried with Grant admin consent as well
- lbendlin
Super User
Check the validity of the token at jwt.io
- SachinNandanwar
Impactful Individual
You have a keyword "Bearer" in the token. If you are using POSTMAN then it is not required.
- ChristinaODTFrequent Visitor
I tried without Bearer still giving me the same error
- SachinNandanwar
Impactful Individual
Are you using "https://fabric.microsoft.com/.default" scope?
Ths scopes endpoint should be this "https://api.fabric.microsoft.com/.default" instead.
- KevinChant
Super User
It will still work in postman if you use "Bearer" in the token...
- v-veshwara-msft
Community Support
Hi ChristinaODT ,
Thanks for sharing your query. We just wanted to check if the issue has been resolved and whether any of the solutions provided met your requirements. If so, please consider marking the helpful replies as solutions. If you were able to resolve it through a different approach, kindly share the details here, it could benefit others facing similar challenges.
If you're still experiencing issues, please reach out.
For reference, please go through this thread to see if it provides any additional insights:
Solved: Re: Unable to trigger fabric data pipeline using R... - Microsoft Fabric Community
For reference, you may also check the Known Limitations of the Fabric Data Pipeline REST API.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.
Best Regards,
Vinay kumar.- ChristinaODTFrequent Visitor
No nothing works out. I tried everything shared and worked as per the API document given by Microsoft, but the API did not hit the pipelines. Though I found out an alternative approach to make this feature work . I will share the blog link soon here for others facing the same issue
- v-veshwara-msft
Community Support
Hi ChristinaODT ,
As we haven’t heard back from you in a while, so just following up to check if your query has been resolved. If possible, please share the alternative approach or the blog link here, as it could be helpful for others facing a similar issue.Or if you found any of the responses helpful, please consider marking those as Accepted Solution to help others find the answer easily.
Thank you.
- Salini1991Frequent Visitor
Did it work? I am facing the same issue when I call https://api.fabric.microsoft.com/v1/workspaces. I am now getting
{"requestId": "b9c63b6d-27f3-42a3-a2d9-d733a6ebe20d","errorCode": "Unauthorized","message": "The caller is not authenticated to access this resource"} - v-veshwara-msft
Community Support
Hi ChristinaODT ,
We haven’t heard from you since our last response and wanted to check if your issue has been resolved. If so, please consider marking the helpful reply as the solution to assist others in the community.
If you found an alternative solution, we’d appreciate it if you could share it here to help others facing a similar issue.
Should you need further assistance, feel free to reach out.
Looking forward to your response.
Best regards,
Vinay