Forum Discussion

HamzaR12's avatar
HamzaR12
New Member
5 months ago
Solved

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

  • 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,

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

     

  • HI HamzaR12,

    Checking in to see if your issue has been resolved. let us know if you still need any assistance.

     

    Thank you.

    • HamzaR12's avatar
      HamzaR12
      New 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's avatar
        ibarrau
        Icon for Super User rankSuper 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.