I am getting the following error when trying to connect to PowerBI Service using the PowerShell commandlets. It works fine when I try to call Power BI REST APIs from Python. Any inputs will be appreciated.
$secrets = Get-AzKeyVaultSecret -VaultName $keyVaultName -AsPlainText -Name $secretName
$secrets = $secrets | ConvertTo-SecureString -AsPlainText -Force
$credential = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $clientId, $secrets
Connect-PowerBIServiceAccount -Tenant $tenantId -ServicePrincipal -Credential $credential
Error:
Hi @VijayKommaraju ,
You are encountering an authentication error while attempting to connect to Power BI Service using PowerShell. The error message indicates issues with token acquisition and authorization.
To troubleshoot this issue, you can:
- Verify the service principal credentials and ensure they have the necessary permissions.
- Check the Azure AD app registration for correct API permissions.
- Ensure that the service principal is correctly configured in the Azure Key Vault.
- Test connectivity using a simple script or another method to isolate the problem.
For more specific help, try running your query in Data Mentor.
Cheers,
Enterprise DNA Support Team