Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I've been getting a bad request calls to two of the admin APIs, GetGroupsAsAdmin and GetAppsAsAdmin, despite making calls in line with what the documentation (https://learn.microsoft.com/en-us/rest/api/power-bi/admin/groups-get-groups-as-admin) says.
I can make calls successfully to other admin APIs (e.g. dataflows and datasets). The difference with these two seems to be that they both have mandatory $top parameters, but I get the error whether or not I supply this parameter.
Connect-PowerBIServiceAccount
Invoke-PowerBIRestMethod -Method Get -Url "https://api.powerbi.com/v1.0/myorg/admin/groups?$top=10"
$Error[$Error.Count - 1].Exception.InnerException
I've connected both as a tenant admin and as a service principal with the admin scope allowed and not had success with either. Are these APIs broken or am I doing something wrong?
Solved! Go to Solution.
Using fiddler, found out that $top parameter wasn't being sent - the dollar sign required for the parameter name meant PowerShell was pulling in a session variable that didn't exist (so the uri would have been "https://api.powerbi.com/v1.0/myorg/admin/groups?=10" ).
The correct syntax is as below:
Invoke-PowerBIRestMethod -Method Get -Url "https://api.powerbi.com/v1.0/myorg/admin/groups?`$top=10"
I guess that's the problem with using the PowerShell ISE, string and variable are highlighted in only slightly different shades of brown!
Using fiddler, found out that $top parameter wasn't being sent - the dollar sign required for the parameter name meant PowerShell was pulling in a session variable that didn't exist (so the uri would have been "https://api.powerbi.com/v1.0/myorg/admin/groups?=10" ).
The correct syntax is as below:
Invoke-PowerBIRestMethod -Method Get -Url "https://api.powerbi.com/v1.0/myorg/admin/groups?`$top=10"
I guess that's the problem with using the PowerShell ISE, string and variable are highlighted in only slightly different shades of brown!
Hi @JoshT
Check this:
Tenant.Read.All or Tenant.ReadWrite.All
Yes, sorry, by tenant admin I meant Power BI service admin, and the service principal I'm using as an alternative has the necessary scope - as I said, other admin APIs work fine, it's just the groups and apps ones that don't work under any circumstances, with any of the parameters specified as per documentation.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
9 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |