SharePoint Online

This plugin provides a read/write connector to interact with SharePoint Online documents and lists
A simple connector to read a sheet from a SharePoint document
Syncing data to SharePoint from DSS.

Plugin information

Version 1.0.2
Author Dataiku (Alex Bourret)
Released 2020-03-16
Last updated 2020-07-21
License Apache Software License
Source code Github
Reporting issues Github

How to set up

Note

This plugin is intended to be used with SharePoint Online only. For the other SharePoint Server editions (2013, 2016, 2019), please refer to the unsupported plugin which can be found here.

Using your SharePoint login

Limitations

This authentication method cannot be used if your account is set up with MFA or if it belongs to a federated space name.

You can find out whether or not this is the case by going to this URL (after editing it with your SharePoint account email address):  https://login.microsoftonline.com/[email protected]. The key NameSpaceType should read Managed. If it is Federated, you will need to use “Site App Token” instead.

Set up

  1. Find the tenant and site name of the SharePoint you want to sync with DSS.

    Microsoft SharePoint screenshot showing the tenant and site name in the URL
    Find your SharePoint tenant and site name from the URL
  2. In DSS, go to Plugins > Installed > SharePoint > Settings > SharePoint login. There, fill in the details of the SharePoint instance you are trying to sync with DSS.
    Dataiku DSS screenshot showing the plugin preset form
    Add a plugin preset

     

Say a typical URL for the files you want to give access to is https://dataiku.sharepoint.com/sites/rnd/plugins/Shared%20Documents/safe/list.xlsx

  • Tenant is the sub domain prior to sharepoint.com, here dataiku
  • Site path is the path to the SharePoint site or sub-site you want to give access to. In this example it would be sites/rnd/plugins
  • Root directory is the path to the highest level directory you want your DSS users to have access to. In the current example, Shared Documents/safe will let the user browse any files and folders in the sub-directory safe. Default value for Root directory is Shared Documents, but it can also be left blank, in which case the user can access all the document libraries of the rnd/plugins site.

Using Azure Single Sign On

  1. From the Azure Portal, go to Azure Active Directory > App registrations create a new App (New registration). Set a name and a redirect URI pointing back to your DSS instance. It should follow this structure: https://<<your DSS instance domain>>:<<your DSS instance port>>/dip/api/oauth2-callback. Unless your DSS instance is on a localhost, the URI has to point to a https secured server.

    Microsoft Azure Portal screenshot showing the app registration form
    Create a new App in Azure Portal
  2. Click on the newly created app. Copy the Application ID. Then go to the Certificates & secrets > New client secret tab. Set a description, choose an expire date, and copy the value of the created secret.

    Microsoft Azure Portal screenshot showing the client secret add form
    Add a client secret to the app
  3. Then navigate to the API permissions tab and add the following permissions: offline_access, openid, User.Read, AllSites.manage, AllSites.Read, AllSites.Write, MyFiles.Read and MyFiles.Write.

    Add permissions to the app
  4. In DSS, go to Plugins > Installed > SharePoint > Settings > Azure Single Sign On. There, set paste the App ID and App secret copied from step 1. The authorization endpoint should be https://login.microsoftonline.com/common/oauth2/authorize?resource=https://<<Your Tenant>>.sharepoint.com (make sure to set the appropriate tenant)

    Dataiku DSS screenshot showing the plugin preset form
    Add a plugin preset
  5. Go to Profile & settings > Credentials for your DSS account. Click the edit button for the SharePoint preset you are configuring. This will redirect you to a Microsoft Single Sign On page. Log in to the account if necessary click Yes

    Dataiku DSS screenshot showing the authorization token request
    Trigger the credential request

Using Site App token

  1. Register an app with your SharePoint site by going to site’s URL followed by /_layouts/15/appregnew.aspx. The whole URL should look like this: https://{your tenant name}.sharepoint.com/{your site path}/_layouts/15/appregnew.aspx. Pick a name, generate the client ID and secret and copy them. Set localhost as App Domain, and https://localhost as redirect URL.
  2. Next you will have to give the token the proper access rights. Go to your site’s URL followed by _layouts/15/appinv.aspx. The URL should look like this: https://{your tenant name}.sharepoint.com/{your site path}/_layouts/15/appinv.aspx.
  3. Enter the client ID created at step 1 and press Lookup
  4. In the Permission Request XML box, copy and past this: <AppPermissionRequests AllowAppOnlyPolicy="true"><AppPermissionRequest Scope="http://sharepoint/content/tenant" Right="FullControl" /></AppPermissionRequests>. More details about rights can be found on SharePoint’s documentation.
  5. Finally, press Create and OK
  6. Find your tenant ID. To do this, click on Cog > Site settings > Site collection app permissions. There you should see the App you created in step 1. The App Identifier contains two alphanumerical strings separated by a @ symbol. The string left of the @ is your app ID. The string right of the @ is your tenant ID. Copy it.
  7. In DSS, go to App > Plugins > Installed > SharePoint Online > SharePoint Online Site App Permissions. Create a new preset, and paste the tenant name, client secret, client ID and tenant ID. This preset will now be useable by using Site App Permissions as type of authentication.

How to use

  • In your DSS project flow, select Dataset > SharePoint
  • Click Shared Documents or Lists, according to the data source you are trying to sync DSS to.
  • Pick the authentication type and the preset, and browse to the document or folder you want to use as dataset. If the source is a list, you will have know its name beforehand.

    Dataiku DSS screenshot showing the dataset path selector
    Browse to the dataset path

Export data back to SharePoint Online

  1. On your SharePoint Online, create a destination directory
  2. On your DSS project flow, create a SharePoint folder by pressing Dataset > Folder and selecting the SharePoint Server Shared Documents plugin as Store into parameter
  3. You will get a red error box at this stage. You need to go to the Settings tab and set the correct type of authentication and connection. Once this is done, type “/” in the path window and press then Browse. Navigate to the destination directory created on step 1 and press OK.
  4. In your DSS flow, pick the dataset you want to export back to SharePoint, and select the Export to folder recipe. In the Export Recipe window, click on Use existing and pick the folder you created in steps 2-3. You can change the file format to you liking.
  5. Save and Run, and your dataset will be exported to the SharePoint directory.

Get the Dataiku Data Sheet

Learn everything you ever wanted to know about Dataiku (but were afraid to ask), including detailed specifications on features and integrations.

Get the data sheet