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
ginoroy
Frequent Visitor

Power BI Admin API - Get Datasets

Hi,

 

Does anyone know how to get the datasourceUsages info when calling the Power BI Admin apis? Using either Datasets GetDatasetsAsAdmin  or Groups GetGroupsAsAdmin  expanded with datasets. The documentation refers to a DatasoureUsage array but the api does not return any

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @ginoroy ,

 

How did you connect to the Rest API, PowerShell or web connector?

Please show your M code in 'Edit Query' or the shell code.

Please refer to the code.

Connect-PowerBIServiceAccount

$Workspace = Get-PowerBIWorkspace -All

ForEach($Workspace in $Workspace)
{
    $Url = 'https://api.powerbi.com/v1.0/myorg/groups/'+ $Workspace.Id + '/datasets'
    Invoke-PowerBIRestMethod -Url $Url -Method Get
 }

Disconnect-PowerBIServiceAccount

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @ginoroy ,

 

Has your problem been solved?

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-lionel-msft
Community Support
Community Support

Hi @ginoroy ,

 

How did you connect to the Rest API, PowerShell or web connector?

Please show your M code in 'Edit Query' or the shell code.

Please refer to the code.

Connect-PowerBIServiceAccount

$Workspace = Get-PowerBIWorkspace -All

ForEach($Workspace in $Workspace)
{
    $Url = 'https://api.powerbi.com/v1.0/myorg/groups/'+ $Workspace.Id + '/datasets'
    Invoke-PowerBIRestMethod -Url $Url -Method Get
 }

Disconnect-PowerBIServiceAccount

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-lionel-msft ,

 

I am also trying to achieve the same automation, however, this requires a user interaction to login. MFA is enabled for our tenant. and service principal with client id and client secret are unable to return Admin API. Is there a way around this? To be able to automate the process? Many Thanks 

aj1973
Community Champion
Community Champion

Hi @ginoroy 

I beleive this video can help you.

https://www.youtube.com/watch?v=fC6SK2TkoS0

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

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.