Reputation: 257
I am trying to copy CSV file from Sharepoint online to Data lake using Data Factory. I followed the below documentation.
My pipeline looks below
I am getting errors in the copy data activity. My connection to Sharepoint is successful, and even I can download the CSV file using the base & relative URL.
Below is my error
Error code 2200
ErrorCode=HttpRequestFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Http request failed with client error, status code 403 Forbidden, please check your activity settings. If you configured a baseUrl that includes path, please make sure it ends with '/'.
Request URL: https://xxxx.sharepoint.com/sites/39421875/_api/web/GetFileByServerRelativeUrl('/sites/39421875/Shared%20Documents/Test.csv')/$value.,Source=Microsoft.DataTransfer.ClientLibrary,''Type=System.Net.WebException,Message=The remote server returned an error: (403) Forbidden.,Source=System,'
My base URL: https://xxx.sharepoint.com/ Relative URL: sites/39421875/_api/web/GetFileByServerRelativeUrl('/sites/39421875/Shared Documents/Test.csv')/$value
Not sure why the above error is coming? I added "/" in the base URL.
I tried multiple times, and the same error is happening. Even I tried to give a complete URL in the base URL but with no success. I followed the documentation for the Additional Header.
Can anyone advise?
Upvotes: 1
Views: 2647
Reputation: 2739
The above error is mainly because of Authorization Failure. Please make sure to check whether the below permissions are granted or not.
Go to Azure Active directory -> App registration and open app -> API permission -> Add this permissions.
And also please follow the below reference: It has detailed information about app permission on specific site collection and Authorization of SharePoint.
Reference:
DataFactory: Extract data from SharePoint Online by javiBI
Access SharePoint Online using Postman by Shantha Kumar
Upvotes: 0