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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
samgreene1
Resolver I
Resolver I

How to set up SharePoint refresh using a service account or service principal

Hi,

What are the recommended options for setting up data refresh with a service account of some type, so that it is not tied to a user's account?  

 

So far, these are options I've gathered:

1. Create a new Windows service account that is synced to our Azure tenant.  Grant access to Sharepoint list and workspace as needed.  This account needs a Power BI Pro account.  Run As with this account and configure the data source. Password can be set not to expire if needed. 

 

2. Use the service principal method.  In Azure Entra, create app registration, secret, and group. Add the group to the premium PBI workspace and admin portal for API access.  Grant rights to SharePoint list.  For dataset credentials, enter tenant, app id and secret id (shown as Service Principal Key?).  This secret will need to be updated in every dataset when the secret expires at max 2 years.

 

I just tested this method (#2) and got the error "Failed to get access_token for sharepoint URL"

 

Are there other options? Any ideas on the error I am getting? 

How would one identify the datasets that need to be updated when the secret is expiring? 

3 REPLIES 3
GilbertQ
Super User
Super User

Hi @samgreene1 

 

COuld you make sure that you are using the App ID from the Service Principal when configuring the refresh?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

That's helpful, thanks.  I now get another error:  The credentials provided for the SharePoint source are invalid.

Hi, @samgreene1 

 

Please refer to the following links in the hopes of helping you.
Solved: The credentials provided for the SharePoint source... - Microsoft Fabric Community

Solved: Erorr-Credentials provided for Sharepoint source a... - Microsoft Fabric Community

Solved: SharePoint source forgets credentials on scheduled... - Microsoft Fabric Community

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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