I am trying to connect Azure Data Factory (ADF) to a SharePoint data source, but I am getting an error while trying to fetch metadata.
Below are the error details:
Error code: 23201
Message:
"Failed to get metadata of odata service, please check if service url and credential is correct and your application has permission to the resource. Expected status code: 200, actual status code: Unauthorized (401)."
Additional details:
- Activity ID: 9b0b7499-0eb2-4e09-a779-701b8f4bffe7
- Response: {} What I have done so far:
- Created Linked Service in Azure Data Factory for SharePoint
- Tried using Service Principal (Client ID + Secret) - Also tried HTTP + OAuth token approach
- Generated access token via Azure AD
- Verified the SharePoint site URL and dataset configuration
However, I am still getting a 401 Unauthorized error when ADF tries to read metadata.
Questions:
1. What could be causing the 401 Unauthorized error in ADF when accessing SharePoint?
2. Do I need additional permissions on Azure AD (e.g., Sites.Read.All, Files.Read.All)?
3. Is there any specific configuration required for SharePoint OData endpoints in ADF?
4. Has anyone faced this issue when using Graph API vs SharePoint REST API?
Any guidance or working configuration would be really helpful.
Thanks in advance!