Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Using Service Principal for refreshing datasets published in PowerBI Premium Per user workspace

Hi,

Can we use service principal to automate refresh of Tabular models that are deployed to PowerBI Premium Per User workspace?

 

We plan to use Azure Automation runbook to achieve this.

 

Regards,

Ashish

6 REPLIES 6
Anonymous
Not applicable

When I try to use the service principal, from the runbook, I am getting the following error message.

 

aruparel_0-1644336824610.png

 

What is the error code responding? (I mean number, 400, 403, 404, 500, etc)

It looks like you are not being able to autheticate to get the authorization or bearer token to make the request of refresh.

Remember you need to authenticate first, get the big token and then use that to trigger the refresh. You need the Service Principal configured like the post I have sent.

Regards,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

I did speak with MS Support and they confirmed that currently Service Principals are not supported in Premium Per User Workspace.

 

As a workaround, for the development environment, I created a user credentials within Automation and used that credentials for authentication and refresh of the tabular models that are deployed to PowerBI Premium Per User Workspace.

 

Regards,

Ashish

I was confused with your answer, so I tried this morning. I was able to use a Service Principal and Run a Refresh for a dataset in a Premium Per User Workspace.
The SP was admin in the workspace and it is also admin to handle the PBI API (the option in the tenant settings under admin portal).

The doc doesn't say anything about that limitation: https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group

I think you have a problem in the environment or the requests.

Regards

P/D I have used a python lib to test it.


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

I tried refreshing the dataset using Service Principal but not able to acheive it. I also get the bearer token, still it is showing to Sign in to your account. 

In the Azure Automation account, I have import the MicrosoftPowerBIMgmt.Profile module and created the powershell runbook.

Below is the powershell script:

Screenshot 2022-08-10 at 12.24.37 AM.png

ibarrau
Super User
Super User

Hi, sure you can. You can follow this post to set up some configurations until the data factory section starts
https://blog.ladataweb.com.ar/post/642023841877671936/azuredatafactory-actualizar-powerbi-con

Then you can write your runbook in any language to make two requests. One for geting the bearer token and another to post the refresh.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.