Forum Discussion
List of Datamarts using Cmdlets/REST API
- 1 year ago
Hi. The Fabric Administrators (the ones with that specific rol in EntraID) can see a Admin Workspace at the Fabric Portal. That one has three reports. One of them is Purview Hub there is a page for Item Explorer at the whole tenant. You can filter by item type and check whatever you want.
As far as I remember the Power Bi Rest API doesn't have datamart as item to explore. The Fabric Rest API has added the datamarts to list them as admin but it can be trickier to work on that code than opening this.
I hope that helps,
Hi RichardCooper ,
The easiest way is definitely PowerShell (no coding required), but the REST API works too if you want to automate further.
PowerShell Method (Quick & Admin-Friendly):
-
Install the Power BI PowerShell module (if you don’t already have it): Install-Module -Name MicrosoftPowerBIMgmt -Scope CurrentUser
- Sign in to your Power BI tenant: Connect-PowerBIServiceAccount
- Get all Datamarts you have access to and export as CSV: Get-PowerBIDatamart -All | Export-Csv -Path "DatamartsList.csv" -NoTypeInformation
REST API Method (Best for Automation/Developers):a
To get a full list, you actually need to:
-
List all workspaces:
GET https://api.powerbi.com/v1.0/myorg/groups -
For each workspace, get the Datamarts:
GET https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datamarts
So it’s a two-step loop, there’s no single API call that returns all Datamarts in every workspace at once.
- RichardCooper1 year agoNew Member
Thank you very much for you're reply, it's certainly given me something to look at, but the answer I accepted got me to the immediate answer I needed.