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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
Neka
Helper III
Helper III

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
Microsoft Employee
Microsoft Employee

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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