Forum Discussion
PowerShell Login with Connect-PowerBIServiceAccount +ServicePrincipal error
- 6 years ago
Forget about my message. I found the solution. Everything is now running fully as expectedππππ
Forget about my message. I found the solution. Everything is now running fully as expectedππππ
What was the solution MawashiKid2 ?
- rockymtnrajah4 years agoFrequent Visitor
The solution is to use an SPN (Register an app to embed Power BI content in a Power BI embedded analytics application - Power BI | Microsoft Docs). Once you have an SPN your code will change to:
#replace bold items with your values
$applicationId = "<guid>";
$securePassword = "<password>" | ConvertTo-SecureString -AsPlainText -Force
$credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $applicationId, $securePassword
Connect-PowerBIServiceAccount -ServicePrincipal -Credential $credential -TenantId "<tenantid-guid>"