Forum Discussion

krstn17's avatar
krstn17
Regular Visitor
8 months ago
Solved

Combine Binaries: We couldn't authenticate with the credentials provided

Hello,

 

I have a Power Query where I access a SharePoint site using the function SharePoint.Contents. The query steps are then set to navigate to the correct subfolder and find a specific folder name based on input parameters. Once the navigation is at the correct folder, I have the query steps set up to combine the binaries for all files in the folder. Each file contains an Excel table named wp_summary with the exact same column structure that gets combined into one large table. 

 

I have zero issues connecting to SharePoint in the sample file query group that is created upon combining the files/binaries. I can sell that it is pulling in the right navigation path and can see all of the files in the folder that need to be combined, so the sample query is authenticated and connected to the site.

 

However, in my actual query, once the custom function is invoked to make the transformations that are done to the sample file and apply those transformations to all files/tables in the folder, I get an authentication error. 

 

It always prompts me to re-sign in and then, once signed in, I try to connect. The connection fails, and the error says, "We couldn't authenticate with the credentials provided." This happens even though I was signed in and connected to the sample query.

 

The maddening part of this is that I have this exact same file & queries on several other SharePoint sites we have, and the connection works fine and does not have these issues. The file path is slightly different on this site when drilling into the subfolders, but I've ensured that the folder path that isn't working contains no special characters and does not exceed the 400 character file path limit.

 

I've tried clearing my data sources multiple times. I've rebuilt the whole query from scratch.

 

I've also compared the SharePoint site permissions of this site where the file doesn't work with the sites where it does work, and on the surface, they appear to be the same. I have the same permissions to each site.

 

What am I missing? How do I make this query work? Is there a permission box I need to look at or something else to consider in the file path?

 

Thanks in advance for your help.

 

Edit: I tried to combine binaries on a single file rather than all files in a folder and that throws the same authentication error.

  • I solved my own issue after reading a lot of comments on other similar posts.

     

    If any file in the SharePoint Library folder has a "#" in the file name, the Power Query will throw an authentication error and won't connect.

3 Replies

    • krstn17's avatar
      krstn17
      Regular Visitor

      Thank you for the response. However, this is built in Power Query and not Power BI. There is no option in Power Query to go to "Settings." There is only "Query Options" and "Data Source Settings," neither of which have the "Use my default web browser" option.

  • krstn17's avatar
    krstn17
    Regular Visitor

    I solved my own issue after reading a lot of comments on other similar posts.

     

    If any file in the SharePoint Library folder has a "#" in the file name, the Power Query will throw an authentication error and won't connect.