This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. 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.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 10 | |
| 8 | |
| 8 | |
| 8 | |
| 7 |
| User | Count |
|---|---|
| 49 | |
| 27 | |
| 24 | |
| 20 | |
| 20 |