Search code examples
azure-data-factory

Unable to Create A Link Service to Sharepoint Onlist List with Azure Data Factory


Can somoene confirm that the reason I'm unable to create a Link Service or connection to Sharepoint Online is because I don't have the necessary permissions to SharePoint Online List. And if that is the case when needs to be done on SharePoint Online List to grant the necessary permissions? enter image description here

I forgot to mention that when I try to connect from a different instance of Data Factory I get a slightly different error 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: Forbidden, response is : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


Solution

  • I tried the above scenario in my environment and got the same error.

    enter image description here

    To resolve this error, we need to grant SharePoint Online site permission to your Service principal.

    To do that, I followed this Documentation and granted the permissions in this URL https://[your_site_url]/_layouts/15/appinv.aspx.

    enter image description here

    Give the App Id of service principal, any title and for App Domain and Redirect URL refer the same documentation which had explanation on those.

    I have give the App Domain as <oragnization>.sharepoint.com and the Redirect URL is the display of page of sharepoint which lists the content of my site.

    Ex: https://<oraganization>.sharepoint.com/sites/<site_name>/Lists/<list_name>/AllItems.aspx

    After granting the permission, I am able to create the linked service successfully.

    enter image description here

    Coming to your first error, it might be due to the Data factory roles and permissions. Check the roles between your first ADF and second ADF. I have Contributor role in my ADF.