I am having permission issues when trying to access MS Sharepoint files from MS Synapse. How to solve this?

João Flavio Assunção Mendonça 20 Reputation points
2024-11-28T15:06:51.8866667+00:00

Dear Community,

Since a while I am trying to read a file from Sharepoint and paste it into a Blob Storage within MS Synapse, however, even being able to correctly receiving the token when I try to copy and paste the file I see the error bellow:

I cannot see all my permissions at Azure but our Azure Admin told me he gave me all the permissions in the Sharepoint folder.

Does someone have any idea what is the problem here?

Thanks

Unauthorized access. Check your access token or permissions. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns:o="urn:schemas-microsoft-com:office:office" lang="en-us" dir="ltr"> <head><meta name="GENERATOR" content="Microsoft SharePoint" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Expires" content="0" /><meta http-equiv="X-UA-Compatible" content="IE=8"/><meta name="ROBOTS" content="NOHTMLINDEX" /><title> Error </title><link id="CssLink-b2a70bdb2f23418fbbdfb18e33587cd2" rel="stylesheet" type="text/css" href="/_layouts/15/1033/styles/corev15.css?rev=chy2wPQZ%2FZ9Vh0GcszUdXw%3D%3DTAG500"/> <link id="CssLink-4716a525c34444a9a8842cb6928f7d9b" rel="stylesheet" type="text/css" href="/_layouts/15/1033/styles/error.css?rev=tF7fyfzbaQzNoASoSDlV4A%3D%3DTAG500"/> <script type="text/javascript">// <![CDATA[ var _initGlobalSnapShot = {};try { if (Object.keys(_initGlobalSnapShot).length == 0) { for (var memberIndex in window) { if (Boolean(memberIndex)) { _initGlobalSnapShot[memberIndex] = 1; } } }} catch (ex) {}; // ]]> </script> <script type="text/javascript">// <![CDATA[

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,542 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,380 questions
Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

Accepted answer
  1. Chandra Boorla 14,680 Reputation points Microsoft External Staff Moderator
    2024-12-05T07:00:47.9566667+00:00

    @João Flavio Assunção Mendonça

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.

    Issue:

    Since a while I am trying to read a file from Sharepoint and paste it into a Blob Storage within MS Synapse, however, even being able to correctly receiving the token when I try to copy and paste the file I see the error bellow:

    I cannot see all my permissions at Azure but our Azure Admin told me he gave me all the permissions in the Sharepoint folder.

    Does someone have any idea what is the problem here?

    Thanks

    Unauthorized access. Check your access token or permissions. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns:o="urn:schemas-microsoft-com:office:office" lang="en-us" dir="ltr"> <head><meta name="GENERATOR" content="Microsoft SharePoint" /><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta http-equiv="Expires" content="0" /><meta http-equiv="X-UA-Compatible" content="IE=8"/><meta name="ROBOTS" content="NOHTMLINDEX" /><title> Error </title><link id="CssLink-b2a70bdb2f23418fbbdfb18e33587cd2" rel="stylesheet" type="text/css" href="/_layouts/15/1033/styles/corev15.css?rev=chy2wPQZ%2FZ9Vh0GcszUdXw%3D%3DTAG500"/> <link id="CssLink-4716a525c34444a9a8842cb6928f7d9b" rel="stylesheet" type="text/css" href="/_layouts/15/1033/styles/error.css?rev=tF7fyfzbaQzNoASoSDlV4A%3D%3DTAG500"/> <script type="text/javascript">// <![CDATA[ var _initGlobalSnapShot = {};try { if (Object.keys(_initGlobalSnapShot).length == 0) { for (var memberIndex in window) { if (Boolean(memberIndex)) { _initGlobalSnapShot[memberIndex] = 1; } } }} catch (ex) {}; // ]]> </script> <script type="text/javascript">// <![CDATA[

    Solution:

    Thanks a lot for your comments, this part of your text here was essential for me to come with a soluition: "Service Principal/Identity Permissions - If you're using a managed identity (either user-assigned or system-assigned) for Synapse, ensure that this identity has the necessary roles/permissions in both Azure AD and SharePoint. If you're using a service principal to authenticate, verify that it has the appropriate Azure AD app permissions (e.g., Sites.Read.All)."

    Based of this comment I could see that I only giving permissions in Azure was not sufficient I also needed permissions in Sharepoint, which by the way is very complicated to set... I had the impression that this feature is not yet complete developed by Microsoft..

    For those who also need a step by step procedure in how to copy files from Sharepoint into MS synapse I recommend this link as well:

    https://www.syntera.ch/blog/2022/10/10/copy-files-from-sharepoint-to-blob-storage-using-azure-data-factory/

    or a more advanced approach here:

    https://learn.microsoft.com/en-us/azure/data-factory/connector-sharepoint-online-list?tabs=data-factory

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. João Flavio Assunção Mendonça 20 Reputation points
    2024-12-04T07:45:51.03+00:00

    Dear Chandra,

    Thanks a lot for your comments, this part of your text here was essential for me to come with a soluition: "Service Principal/Identity Permissions - If you're using a managed identity (either user-assigned or system-assigned) for Synapse, ensure that this identity has the necessary roles/permissions in both Azure AD and SharePoint. If you're using a service principal to authenticate, verify that it has the appropriate Azure AD app permissions (e.g., Sites.Read.All)."

    Based of this comment I could see that I only giving permissions in Azure was not sufficient I also needed permissions in Sharepoint, which by the way is very complicated to set... I had the impression that this feature is not yet complete developed by Microsoft..

    For those who also need a step by step procedure in how to copy files from Sharepoint into MS synapse I recommend this link as well:

    https://www.syntera.ch/blog/2022/10/10/copy-files-from-sharepoint-to-blob-storage-using-azure-data-factory/

    or a more advanced approach here:

    https://learn.microsoft.com/en-us/azure/data-factory/connector-sharepoint-online-list?tabs=data-factory

    Thanks


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.