Copy file from SharePoint Online

Gayatri Krishnan 41 Reputation points
2022-04-14T00:39:48.42+00:00

I am trying to build an ADF pipeline that download excel file from Sharepoint online. I have followed the necessary prerequisite steps as suggested in document https://learn.microsoft.com/en-us/azure/data-factory/connector-sharepoint-online-list?tabs=data-factory#copy-file-from-sharepoint-online

But still not luck. Web activity fails indicating unauthorized client. The app registration was successful on the Sharepoint online site and also related permissions shows it has AllSites.Read permission granted for it.

Not sure what am I missing. Any inputs how to resolve this error

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.
4,539 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,862 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saurabh Sharma 23,771 Reputation points Microsoft Employee
    2022-04-15T21:47:16.077+00:00

    Hi @Gayatri Krishnan ,

    Thanks for using Microsoft Q&A !!
    If I understand correctly, your web activity is failing to get Sharepoint Online tokens using the registered application.
    By error message it looks like application registration or permissions issue.
    Are you checking permissions under Registred applications on Azure Active Directory blade on Azure portal?
    Can you please check your Sharepoint application principals site by going to https://{Sharepoint Name}.sharepoint.com/_layouts/15/appprincipals.aspx?Scope=Web if your application is showing up there.
    193572-image.png

    If not, then please try to follow step 2 - Grant SharePoint Online site permission to your registered application of the documentation. Please make sure you are passing the exact XML as mentioned like below

    <AppPermissionRequests AllowAppOnlyPolicy="true">
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="Read"/>
    </AppPermissionRequests>

    Thanks
    Saurabh