Logic App SharePoint Online Get Files Error Only When Limiting to Folder: Missing Authorization header for a privileged call on connection

Mike Qu 141 Reputation points
2020-08-13T21:33:29.413+00:00

I'm trying to use the Logic App SharePoint Online connector's "Get Files (properties only)" action. I have an account with full access to the SharePoint site connected. Then I set the "Site Address" and "Library Name" properly.

It works perfectly with this default setup: basically getting all files from the library works fine. I can also use the "Top Count" option, no problem.

But I want to use the "Limit Entries to Folder" filter to only get files from a specific folder in the library. As soon as I enable this and select the desired folder, the Logic App returns the following outputs in the body:

{
  "@odata.nextLink": "https://logic-apis-centralus.azure-apim.net/apim/sharepointonline/xx_link_omitted_here",
  "value": []
}

Upon opening the URL in the @odata.nextLink header, the following json is shown:

{
  "Message": "Missing Authorization header for a privileged call on connection.",
  "Source": "product policy"
}

Again, this only happens if I use the "limit to folder" option. I tried changing connection accounts, same result.

Then I tried this on other sites and libraries. Strangely, this does not happen to every SharePoint sites either, but it only happens to the two sites I actually need to run the Logic App against (both are fairly standard modern SP sites, with about 80k files each).

I've spent hours trying to make this work without success. Any advice would be greatly appreciated!

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,197 questions
0 comments No comments
{count} vote

Accepted answer
  1. Mike Qu 141 Reputation points
    2020-08-14T16:27:50.483+00:00

    This error was resolved by setting "Include Nested Items" to "No". It seems when the library/list is large and limiting to folder is enabled with "included nested items" set to "yes" (default), the connector breaks with the unauthorized error. I assume this is a bug.

    3 people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.