Forum Discussion

tcboeira's avatar
tcboeira
New Member
2 years ago
Solved

How to authenticate using a Service Principal?

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

3 Replies