Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I am trying to refresh a Power BI dataset using a Service Principal and PowerShell. I have followed all the requirements and steps outlined in the following documentation:
https://powerbi.microsoft.com/en-us/blog/announcing-support-for-service-principals-using-the-xmla-en...
1. Created a service principal
2. Enabled service principals access to Power BI tenant
3. Added the service principal into my workspace (I am using a Premium Per User workspace)
4. Enabled XMLA read/write
Here is my PowerShell script:
$applicationid = 'xxxxxxxxxxxxxx'
$password = ConvertTo-SecureString 'xxxxxxxxxxxxxx' -AsPlainText -Force
$credential = New-Object System.Management.Automation.PSCredential ($applicationid, $password)
$Server = "powerbi://api.powerbi.com/v1.0/myorg/my_workspace"
$TenantId = "xxxxxxxxxxxxxx"
Invoke-ProcessTable -Server $Server -TableName "Dimension Supplier" -DatabaseName "WideWorldImporters" -RefreshType "Full" -ServicePrincipal -Credential $credential -TenantId $TenantId
Here is the error that I get:
"Invoke-ProcessTable : The "WideWorldImporters" database does not exist on the server."
When I use a normal user account by signing in, the refresh works. However, it does not seem to work when I pass in the service principal.
Any ideas of what could be wrong?
TIA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.