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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
tim_rodewig
New Member

Dataset refresh failed with Service Principal (Power BI REST API)

Hello PBI-Developer-Community,

 

we've developed a power bi automate flow to publish a power bi report in a power bi workspace to automate the report creation. The report is connected to databricks (import mode not live query). After importing the report into the workspace using a service principal we're not able to refresh the dataset. We see the following error message in the dataset settings: 

 

Data source error: Scheduled refresh is disabled because at least one data source is missing credentials. To start the refresh again, go to this dataset's settings page and enter credentials for all data sources. Then reactivate scheduled refresh.

If I takeover the ownership of the dataset manually we are able to refresh the dataset so I tried to update the dataset owner via the power bi rest api using the service principal using the appropiate url Patch this: 

 

PATCH https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}

Header: Authorization Bearer XXXXXXYYYYYYYYYYYYZZZZZZZZ

body: { "configuredBy": "myuser@mydom.com" }

 

The PATCH was successfully executed but the owner is still the Service Principal. Any ideas how to solve this?

1 ACCEPTED SOLUTION
Deku
Community Champion
Community Champion

If you have a gateway you can bind the model to a gateway connector pre authenticated by a user

https://learn.microsoft.com/en-us/rest/api/power-bi/reports/bind-to-gateway-in-group

I have a feeling this should also work for shared cloud connections as they have a gatewayid associated with them, distinct from on prem and VNET gateways that you may or may not have

 

You will need to give the SNP access to the connection.


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @tim_rodewig ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Deku
Community Champion
Community Champion

why is a problem that the service principal is the owner?

 

You've already patched the crenentials. If you need to setup a refresh schedule then you can use another API https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/update-refresh-schedule-in-group. There is a API to transfer ownership, but only to the user authenticated when running the API. If you want ownership you have to do to do so manually in the service

 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Thanks for the quick reply. The problem is that the report is connected to databricks and this connection does not work with the service principal credentials.

Deku
Community Champion
Community Champion

If you have a gateway you can bind the model to a gateway connector pre authenticated by a user

https://learn.microsoft.com/en-us/rest/api/power-bi/reports/bind-to-gateway-in-group

I have a feeling this should also work for shared cloud connections as they have a gatewayid associated with them, distinct from on prem and VNET gateways that you may or may not have

 

You will need to give the SNP access to the connection.


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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