Forum Discussion

jaryszek's avatar
jaryszek
Super User
7 months ago
Solved

How to try REST api logged as service principal from Microsoft tool?

Hello Guys,

I have possibility to test rest api calls using Try it feature within docs like here:
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/execute-queries-in-group#code-try-0

 

 

Is there any way to log in as service pricipal to test access?

Best,
JAcek

 

  • Hi jaryszek,

    It is not possible to use the Try it feature in Microsoft Learn documentation to test Power BI REST APIs as a Service Principal.The Try it feature only supports interactive delegated authentication (user sign-in) and doesnt support the OAuth 2.0 client credentials (app-only) flow required for service principals

     

    To test Power BI REST APIs as a Service Principal you must obtain an app only access token and call the API using an external REST client (Postman, curl, PowerShell, VS Code REST client or any other tools)

     

    if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.

1 Reply

  • Hi jaryszek,

    It is not possible to use the Try it feature in Microsoft Learn documentation to test Power BI REST APIs as a Service Principal.The Try it feature only supports interactive delegated authentication (user sign-in) and doesnt support the OAuth 2.0 client credentials (app-only) flow required for service principals

     

    To test Power BI REST APIs as a Service Principal you must obtain an app only access token and call the API using an external REST client (Postman, curl, PowerShell, VS Code REST client or any other tools)

     

    if this post helps, then I would appreciate a thumbs up and mark it as the solution to help the other members find it more quickly.