Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Adding a SharePoint data source with a service principal

Hi,

 

I am trying to access files located in SharePoint Online. We would like to use a service principal for the authentication. But when I try to save the credentials I get the following error:

 

Service principal error
 
Unable to update connection credentials.
Invalid connection credentials.
 
Details:
 
The credentials provided for the SharePoint source are invalid. (Source at https://mytenant.sharepoint.com/sites/MySite.)

 

This is what I enter in the data source

 

sharePointSiteURL: https://mytenant.sharepoint.com/sites/MySite

Authentication method: Service principal

Tenant ID: My tenant ID

Service Principle ID: The Application (client) ID from the Entra ID App registration

Service principle key: The value of the secret I created for the Entra ID App registration

 

The Entra ID App registration has the following API permissions

 

The service principal (Entra ID app) has Read permissions on the SharePoint site

What is it I am missing in order to get this to work 🙂 ?

 

Regards Erik

18 Replies

  • pichlerpa's avatar
    pichlerpa
    Frequent Visitor

    Hey,

     

    Setting the property "DisableCustomAppAuthentication" in your SharePoint tenant to "false" is doing the trick, you can use the following PS command :

    Set-SPOTenant -DisableCustomAppAuthentication $false

     

    The problem is that since November 27th, 2023 (depreication of Azure Access Control Services) this is set to "true" by default even though it's still working until April 2, 2026. The currently only (recommended) way is to use certificate-based OAuth2.0 authentication which won't work in the Power BI service though as it requires a local certificate to be integrated, seems to be kind of a technical debt the Power BI team has yet to address.

     

    Hope this helps.

     

    Patrick Pichler
    Owner & Co-Founder

    Teams: Chat with me
    Website: www.creativedata.io
    Follow us: LinkedIn | Medium
    Data Management | Data Analytics & Reporting | Data Apps & APIs | Artificial Intelligence | EU Projects

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    Have submitted this issue internal to confirm, would update here as soon as possible if there is any update about it.

     

    Best Regards
    Community Support Team _ Rongtie

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous,

       

      Thank you for getting back to me!

       

      It would be appreciated if you could come back to me no matter what info you get in the internal ticket you created.

       

      I guess it could be an issue with Power BI.

       

      But it could also be that there is something I have done wrong. If that is the case I would like some guidance on what I have to do in order to get it to work.

       

      Just for your information. I found the below thread which sounds like a similiar issue I have.

       

      https://community.fabric.microsoft.com/t5/Developer/SharePoint-data-source-authentication-method-service-principal/m-p/3570831

       

      Regards Erik

    • Divakaras's avatar
      Divakaras
      New Member

      Hi Anonymous  - We are facing a similar issue when trying to connect to a Sharepoint Online list from PowerBI Online using service principal as the authentication method. Wondering if you have got any guidance from your internal team 

  • zhangjoe's avatar
    zhangjoe
    Microsoft Employee

     

    Service Principle ID: The Application (client) ID from the Entra ID App registration, 
    You need Object ID for the SP ID. Not Application ID. 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi zhangjoe,

       

      When we change from Application (client) ID to Object ID we got another error:

       

      Any idea what might cause this?

  • Did you find a solution to this? I'm facing the same issue

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Mariza,

       

      No, unfortunately I have not found a solution to this 😞

       

      If you have managed to get it working, I would be happy to hear what I need to do.

      • gelouma's avatar
        gelouma
        Frequent Visitor

        Still no news? This problem is getting really annoying.

  • Hello,

    did you find a solution for this ? I habe now the same issue with the same error message. I tried also to create a Ticket but it was closed with the message Microsoft has no ressources and i sould contact a partner.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      No, unfortunately no resolution yet. The case I have with Microsoft is still open.

  • Having the same issue. This is our first time setting up a Service Principal to access SharePoint sites in Power BI, and I'm glad I found this thread because it seems like we're not the only ones having issues.

  • sujaza's avatar
    sujaza
    Regular Visitor

    Did you find a solution to this issue? I could connect to sharepoint lists and get the data, but not excel files in document libraries!

  • Hello,

    Is there a solution for this topic?

    I am also getting an error (error 400 : the credentials are invalid) while trying to use a principal service to authenticate a semantic model (with a Sharepoint site).

    Thanks in advance.

  • I'm facing the exact same problem. Are there any news or tips on this?