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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to get API Bearer Token for Power BI Admin apis

I am trying to use https://login.microsoft.com/ <tenet id>/oauth2/token to get access token for Power BI Admin apis.   

I have set up a application and security group in AD and granted all the read access required.    I can paste in a token into api call and it works.  I can use the above api and return an access token in Postman.   How can do it in Power BI using an Service Principal as  documented in https://docs.microsoft.com/en-us/power-bi/admin/read-only-apis-service-principal-authentication    I get error message "We couldn't authenicate with credentials provided. Please try again. "    I am using Anonymous  Access , it only offers 2 options 

https://login.microsoft.com/ <tenet id>/oauth2 

https://login.microsoft.com/ <tenet id>/oauth2/token

 

Any suggestions would be helpful.     

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User
5 REPLIES 5
Sayantan
Regular Visitor

You have said -

I am trying to use https://login.microsoft.com/ <tenet id>/oauth2/token to get access token for Power BI Admin apis.   

I have set up a application and security group in AD and granted all the read access required.    I can paste in a token into api call and it works.  I can use the above api and return an access token in Postman.

How to do it ?

lbendlin
Super User
Super User
Anonymous
Not applicable

Thank you for replying.   That is using username and password, I didn't mention that I was trying to use Service Principal set up with application permission and as security group. 

Anonymous
Not applicable

Thanks for reply.   Again I am trying to use Service Principal to connect not my username and password.   

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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