Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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!
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 8 | |
| 8 | |
| 7 |
| User | Count |
|---|---|
| 37 | |
| 30 | |
| 26 | |
| 21 | |
| 19 |