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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Neka
Helper II
Helper II

How to automatically generate bearer token and execute a url to retrieve a list of PBI workspaces?

Hello,

 

We are trying to use the PBI Rest API to automate the retrieval and storage of a workspace list. We need to first generate a bearer token to execute this url: https://api.powerbi.com/v1.0/myorg/admin/groups?%24top=5000 and put the results in ADLS. Can this be automated in Azure/Fabric using Azure Data Factory or some other tool? 

6 REPLIES 6
NandanHegde
Super User
Super User

Hey, you can use ADF to executed the REST API and extract the data as stated below:

https://datasharkx.wordpress.com/2022/10/30/copy-data-from-power-bi-through-azure-data-factory-synap...

 

Note : The REST API used in this scenario is different than the one you need to use but you can adjust it accordingly as per your needs.

 

Another way is much more better of using Managed identity in ADF :

https://datasharkx.wordpress.com/2022/11/03/copy-data-from-power-bi-through-azure-data-factory-synap...

but the managed identity way cannot be suuported in fabric as Fabric yet doesnt have this managed identity functionality unlike ADF




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Hello, thanks for your advice. We understand the general idea of how to use the REST API to retrieve the workspace list but we need to know specifically how to do the first step to get the bearer token. Do we have the correct URL for the first step (https://api.powerbi.com/v1.0/myorg/GenerateToken)? And where do we get the credentials for the first step?

Thank you!

Hi @Neka 

 

Apologies for the delay in response.

Have you evaluated Rui's monitoring solution? GitHub - RuiRomano/pbimonitor This is using the scanner API to get all of the catalog and metdata information using a Service Principal account.

 

I hope this helps. Please do let us know if you have any further questions.

Hi @Neka 

 

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.
Otherwise, will respond back with the more details and we will try to help.


Thanks

Hi @Neka 

 

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution please do share that same with the community as it can be helpful to others.
If you have any question relating to the current thread, please do let us know and we will try out best to help you.
In case if you have any other question on a different issue, we request you to open a new thread.


Thanks

v-cboorla-msft
Community Support
Community Support

Hi @Neka 

 

Thanks for using Microsoft Fabric Community.
At this time, we are reaching out to the internal team to get some help on this.
We will update you once we hear back from them.


Thanks

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.