How to fix unauthorized with logic app connector to sharepoint get file content

Michael Francis 0 Reputation points
2026-08-13T15:48:10.8233333+00:00

I am trying to change the assigned user to a new user to run the automation created in my logic app and I get "unauthorized". I verified my user can access the sharepoint site but i get the following error and need help to correct the destination reference for my sharepoint that i am connected to modify so I can connect to another sharepoint I have access.

Error: 401

Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.

0 comments No comments

1 answer

Sort by: Oldest
  1. Allan Solomon Mejia 8,085 Reputation points
    2026-08-13T20:06:59.7666667+00:00

    Hello @Michael Francis

    A 401 Unauthorized after changing the user usually means the Logic App's SharePoint action is still using the existing API connection/authentication context, not simply the permissions of the newly assigned user.

    I would create or re-authenticate the SharePoint connection using the new account, then update the Get file content action to use that connection. Also reselect the Site Address and file/library after changing the connection rather than keeping references generated under the previous account.

    Confirm that the new account has permission to both the SharePoint site and the specific document/library. The SharePoint connector's Get file content action uses the configured connection to retrieve the file by its identifier.

    Also check whether a Conditional Access policy applies to the new user. Microsoft specifically notes that Conditional Access policies, including MFA or device-compliance requirements, can block access through the SharePoint connector.

    After updating the connection, save the Logic App and run it again. If it still returns 401, open the failed action's Inputs/Outputs and share the sanitized error body, especially the message and any innerError, as that should distinguish a stale connector token from a SharePoint authorization issue.

    Reference:

    Microsoft Learn – SharePoint connector: https://learn.microsoft.com/en-us/connectors/sharepointonline/?

    Please "Accept the Answer" if this information helped you.

    Was this answer helpful?


Your answer

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