@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:
or a more advanced approach here:
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.