Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have a script using a service principal to extract power bi workspaces on our tenant.
When I use the code below I get an Unauthroized error code in power shell. This had worked for moths on end before it suddenly stopped. I tried re adding back -Scope Organization and that did not solve the issue either.
$workspaces = Get-PowerBIWorkspace -All
Any ideas?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @aleckealey18 ,
The “Unauthorized” error typically means that the account you’re using doesn’t have the necessary permissions to perform the operation.
make sure it has the necessary permissions. The required scope would look like Group.Read.All, Group.ReadWrite.All, Workspace.Read.All, or Workspace.ReadWrite.All.
During the investigation we found a case that may be similar, hope it helpsc# - Operation returned an invalid status code 'Unauthorized'' - Stack Overflow
Best regards.
Community Support Team_Scott Chang