Greetings & Welcome to Microsoft Q&A forum! Thanks for posting your query!
The error message indicates that your Azure Data Factory Copy Activity is successfully authenticating with SharePoint Online but is encountering a 403 Forbidden error when trying to fetch the file.
Understanding the Error
403 Forbidden means that authentication was successful, but the authenticated user (or app) does not have the necessary permissions to access the requested resource. The request is targeting this endpoint:
https://sharepoint.com/sites/documentation/_api/web/GetFileByServerRelativeUrl('/sites/documentation/Tech documentation/')/$value
This is an API request to get a file from SharePoint using the GetFileByServerRelativeUrl method.
Possible reasons for the issue are either:
- Insufficient permissions on SharePoint for the ADF Managed Identity or Service Principal.
- Incorrect file path (e.g., trying to access a folder instead of a file).
Here are few considerations that might help you:
Check if you are accessing a Folder instead of a File - The URL contains '/sites/documentation/Tech documentation/'
, which looks like a folder instead of a file. If you're trying to fetch a specific file, the URL should look like:
/sites/documentation/Tech documentation/MyFile.xlsx
Make sure you specify the exact file name with the correct extension.
Test API Call in Postman or PowerShell - Try calling the API manually to verify access. If it fails, permissions or the path are incorrect.
Check ADF Copy Activity Settings - Ensure you are using "ServerRelativeUrl" in the dataset configuration. Confirm the SharePoint URL format is correct. If accessing a file inside a folder, do not include the trailing slash (/) at the end of the file path.
Please refer to MS Q&A thread - Copy File from SharePoint not working addressing similar issue.
I hope this information helps. Please 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.