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?
You may try to add parameter -ApplicationId.
@v-chuncz-msft - I added the -ApplicationId parameter but I get the same error. See screenshot below:
@v-chuncz-msft - Can you check if a Service Principal can work with a Premium Per User workspace? I am using a Premium Per User workspace and I think that is why I am getting the permissions error message.
I was able to confirm that service principals are not supported in Premium Per User workspaces which is why I was getting the permissions error.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.