Forum Discussion
SharePoint Online List in Dataflow Gen2
Hi,
I am trying to create a Dataflow Gen2 and Fabric and use a SharePoint Online List as a data source and authenticate via a service principal. I am getting a "invalid credentials" error even though I believe I have followed the correct steps. I'm unsure of what to do next.
1. Created App registration in Entra ID.
2. Granted Microsoft Graph Sites.Selected Read permission and approved by admin.
3. Granted Service Principal read permissions on my specific SharePoint site.
I have validated the Service Principal has the correct permissions, as I am able to use it to pull data into a Lakehouse in Fabric using a notebook.
I did manage to connect once and viewed the list in the Dataflow. I tried to do it again by creating a new list on my SharePoint site, and have since received the invalid credentials error every time. Even the original list which I connected I am now receiving the same error.
When I check the sign-in logs in Entra ID, I can see the service principal sign-ins are successful. The resource is showing as Office 365 Sharepoint Online. However, when I run the Notebook, it shows the resource as Microsoft Graph.
Does anyone know what the potential issue could be caused by? Is it that the Service Principal also needs SharePoint Sites.Selected read permission, and how do I add this? I am also not very familiar with SharePoint in general.
Any help would be greatly appreciated, thanks.
Hi. I don't think it should be trick. The permission should be simple to add if you have access to the service principal. It's adding a delegated permission (don't need admin for that). Once you click add permission and pick delegated, you can see the services like the picture I have sent in order to pick the one from sharepoint you probably didn't have before.
I hope that make sense.
7 Replies
- ibarrau
Super User
Hi. I'm not totally sure about this error, it's quite general but, I remember seing somewhere that it's not just graph Sites.Selected, you should also add a sharepoint delegated permission for the app registrated for Sites.Selected.
Finally, make sure our URL is correct, that you are picking service principal login and that the SP key is not expired.
I hope that helps,
- deborshi_nag
Super User
Hello HamzaR12
Dataflow Gen2’s SharePoint Online List connector authenticates against SharePoint (SPO), not Microsoft Graph. Your service principal works in notebooks (Graph), but Dataflow fails with “invalid credentials” because the app only has Graph Sites.Selected and lacks SharePoint API Sites.Selected (app-only) with site-level consent.
Can you try adding in Entra ID > App registrations > your app > API permissions > Add a permission > SharePoint > Application permissions > add Sites.Selected > Grant admin consent, then explicitly grant the app read (or write) access to the specific site. This aligns permissions for both paths—Graph (notebooks) and SPO (Dataflow Gen2). Hopefully this should fix the issue.
- v-saisrao-msft
Community Support
Hi HamzaR12,
Have you had a chance to review the solution we shared by ibarrau deborshi_nag? If the issue persists, feel free to reply so we can help further.
Thank you.
- v-saisrao-msft
Community Support
HI HamzaR12,
Checking in to see if your issue has been resolved. let us know if you still need any assistance.
Thank you.
- HamzaR12New Member
Hi, I have tried that, I still receive the same error.
I have also granted my service principal Sharepoint API Sites.Selected read permission, but get the same invalid credentials error.
When doing this, is there a different step I need to follow to explicitly grant the app read permissions to my SharePoint site? Or is it the same as how I granted it when using the Graph API?
Thanks- ibarrau
Super User
Hi. I don't think it should be trick. The permission should be simple to add if you have access to the service principal. It's adding a delegated permission (don't need admin for that). Once you click add permission and pick delegated, you can see the services like the picture I have sent in order to pick the one from sharepoint you probably didn't have before.
I hope that make sense.