This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
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
Solved! Go to Solution.
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 @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.
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
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
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 7 | |
| 7 | |
| 6 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 21 | |
| 21 | |
| 19 |