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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bcdobbs
Community Champion
Community Champion

Sharepoint Cloud Connection - Service Principal

I'm trying to move our data connections over to use service principals.

For sharepoint connections I can make it work by setting up a service principal along the lines of Setting up SharePoint app-only principal with App Registration

 

However that is being deprecated in Feb 2026.

 

It looks like I should be able to instead set the permissions using MsGraph along the lines of:

# Replace with your values
$application = @{
    id = "17b4...."   # Client ID of the Managed Identity
    displayName = "Fabric Service Principal"    # Display name (optional but recommended)
}

$appRole = "read"                      # Can be "read" or "write"
$spoTenant = "a****.sharepoint.com"    # Sharepoint site host
$spoSite = "B****"            # Sharepoint site name

# Site ID format for Graph API
$spoSiteId = $spoTenant + ":/sites/" + $spoSite + ":"

# Load Microsoft Graph module
Import-Module Microsoft.Graph.Sites

# Connect with appropriate permissions
Connect-MgGraph -Scope Sites.FullControl.All

# Grant site-level permission
New-MgSitePermission -SiteId $spoSiteId -Roles $appRole -GrantedToIdentities @{ Application = $application }


Going along that route, powershell tells me the service principal has permissions but when I try to connect using Power Bi Service it says credentials are invalid.

 

Any ideas on what I'm missing?



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
1 ACCEPTED SOLUTION
v-priyankata
Community Support
Community Support

Hi @bcdobbs 

Thank you for using Microsoft Community Forum.


Currently, due to some limitations, Power BI Service does not yet support authenticating to SharePoint Online using Microsoft Graph-based service principal tokens.

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-priyankata
Community Support
Community Support

Hi @bcdobbs 
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-priyankata
Community Support
Community Support

Hi @bcdobbs 
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-priyankata
Community Support
Community Support

Hi @bcdobbs 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

v-priyankata
Community Support
Community Support

Hi @bcdobbs 

Thank you for using Microsoft Community Forum.


Currently, due to some limitations, Power BI Service does not yet support authenticating to SharePoint Online using Microsoft Graph-based service principal tokens.

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Akash_Varuna
Super User
Super User

Hi @bcdobbs You might be missing admin consent for Graph API permissions, enabling service principals in Power BI tenant settings, or proper SharePoint site permissions. Also, ensure connection settings in Power BI are correctly configured.

Admin consent is granted, service principals work in power bi (as said it works via sharepoint ACS permissions but they are being retired).

 

Can you expand on what you mean by proper sharepoint site permissions?



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.