Forum Discussion
Connecting PowerBI from Power Shell without prompting
Sorry I am new to PowerBI. I am not aware that I should use either of them. So, in order to use the client certificate, do I need to create it explicitly? For now, I am just trying with service prinicipal, tennent id and application id
If you're going to connect to the REST APIs using the service principal approach, when writing your scripts, you'll also need to supply the client secret or a certificate thumbprint. See the following article: Connect-PowerBIServiceAccount (MicrosoftPowerBIMgmt.Profile) | Microsoft Docs
- kranthi_sunkara4 years agoRegular Visitor
Thanks. Let me try with client secret or a certificate thumbprint
- kranthi_sunkara4 years agoRegular Visitor
I created a certificate thumbprint and passed with other parameters. But I encountered the below error. Is there any specific order for passing the parameters.
Command:
Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint xxxxxxxxxxx -ApplicationId xxxxxxxxxxx -Credential $credential -TenantId xxxxxxxxxxxxxx
=====================================================
Error:
Connect-PowerBIServiceAccount : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprin ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Connect-PowerBIServiceAccount], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerBI.Commands.Profile.ConnectPowerBIServiceAccount- Anonymous4 years agoNot applicable
You don't need the -Credential part. That's only if you're using the Application Secret approach. For me I had the following: Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint XXXXXXXXX -ApplicationId XXXXXX -Tenant XXXXXXXX
- kranthi_sunkara4 years agoRegular Visitor
No luck for me 😞 Getting error again. Not sure if it needs any permissions.
Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint xxxx -ApplicationId xxxxxx -Tenant xxxxxxxxxx
Connect-PowerBIServiceAccount : One or more errors occurred.
At line:1 char:1
+ Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprin ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...IServiceAccount:ConnectPowerBIServiceAccount) [Connect-Po
werBIServiceAccount], AggregateException
+ FullyQualifiedErrorId : One or more errors occurred.,Microsoft.PowerBI.Commands.Profile.ConnectPowerBIServiceAcc
ount