Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello everyone, I hope you are all well!
First of all, I must say that I do not speak another language and that is why I use an online translator.
After extensive research and reading - which does not mean that I did it correctly - I tried several ways without success.
I have an application created and registered in EntraID/AzureAD, working perfectly and being used in some Scripts that automate some actions.
However, to use "Connect-PowerBIServiceAccount" even if I connect, the response is always the same when I want to, for example, simply use the "Get-PowerBIWorkspace -Scope Organization -All" cmdlte. 6. I always get the response "Get-PowerBIWorkspace: Operation returned an invalid status code 'Unauthorized'"
What caught my attention is that when I make the connection using the Application, I get the following return on the screen:
Environment: Public
TenantId:
ClientId: [MY CLIENT ID]
CertificateThumbprint: [MY CERT]
However, note that the "TenantId" is always empty.
However, if I do it using a username and password, it returns filled in. I don't know if this is relevant.
I imagined that this procedure would be "easier" but it hasn't been.
Does anyone have any idea how I can be successful?
Thank you very much to everyone for your attention
Hugs
Solved! Go to Solution.
Thanks for the reply from arvindsingh802.
Hi @tcboeira ,
According to your error information, unauthorized is usually a result of not properly configuring permissions when using the service body or not requesting the corresponding token correctly, you can follow the steps in the following document to configure your Apps, making sure that the steps are configured correctly:
For the issue that Operation returned an invalid status code 'Unauthorized', I found the type of issues for you, you can check this out:
Solved: Re: Unauthorised when using Get-PowerBIWorkspace - Microsoft Fabric Community
Solved: Service Principle cannot Get-PowerBIWorkspace - Microsoft Fabric Community
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Please confirm if you are following all the setps mentioned in this article
https://stackoverflow.com/questions/77939584/how-to-do-the-authentication-to-run-power-bi-rest-api-i...
Yes yes yes... I'm with them indeed...
Thanks for the reply from arvindsingh802.
Hi @tcboeira ,
According to your error information, unauthorized is usually a result of not properly configuring permissions when using the service body or not requesting the corresponding token correctly, you can follow the steps in the following document to configure your Apps, making sure that the steps are configured correctly:
For the issue that Operation returned an invalid status code 'Unauthorized', I found the type of issues for you, you can check this out:
Solved: Re: Unauthorised when using Get-PowerBIWorkspace - Microsoft Fabric Community
Solved: Service Principle cannot Get-PowerBIWorkspace - Microsoft Fabric Community
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.