I'm trying to connect to powerBI by using API from powershell.
this is the code that I'm using:
$common = $PSScriptRoot + "\common.ps1"
##set parent directory for this file
#set project setting file
$parentfDir = Split-Path $PSScriptRoot -Parent
$confDir = getFilePath $parentfDir "\json\automation_tools_seting.json"
#get project settings and package parameter
$conf = loadJsonFile $confDir
$user = $conf.PBI_user
$pass = $conf.PBI_pass | ConvertTo-SecureString -asPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($user, $pass)
Connect-PowerBIServiceAccount -Credential $credential
but it always has an error :
Connect-PowerBIServiceAccount : Failed to get ADAL token:
wondering if there's any mistake inside my code
Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.
We spoke with Power BI Super User, Greg Deckler, about his charity work
Continue your learning in our online communities.