Aller au contenu
EN English versionDemander une démo

Connect SharePoint and OneDrive

For an organisation administrator. Procedure connector.documents.sharepoint, version 1, reviewed 2026-11-09 against the vendor’s own pages. It applies to the connector type documents/sharepoint.

It ships with the platform. In the console it opens with How to set this up, beside the form that adds the connector and on the connector’s settings.

Addresses are written <api_url>, <public_url> and <org> here: the console shows the same text with your deployment’s own.

  • A Microsoft Entra administrator who can grant admin consent (Global Administrator or Privileged Role Administrator).
  • Someone who can grant the app access to each site: a SharePoint administrator, or a Graph caller holding Sites.FullControl.All. Consent alone opens no site (see Permissions).
  • The address of each site to read, for example https://contoso.sharepoint.com/sites/Archi.
  • This is an organisation connector: an organisation administrator declares it once, and knowledge sources pick it by name.
  1. Entra admin center, App registrations, New registration. Name it for the platform, single tenant, no redirect URI.
  2. On the new app’s Overview page, copy the Directory (tenant) ID and the Application (client) ID.
  3. Certificates & secrets, New client secret. Copy the secret’s Value now: it is shown once. The Value is what Tranibor needs, not the Secret ID. A secret expires (24 months at most): note the date in your calendar, because the day it expires every sync of this connector fails.

Least privilege first: the app reads only the sites you name.

  1. API permissions, Add a permission, Microsoft Graph, Application permissions, Sites.Selected, then Grant admin consent. Never Files.Read.All or Sites.Read.All.
  2. Grant the app each site. Find the site’s id with GET https://graph.microsoft.com/v1.0/sites/<host>:/sites/<path> (the answer’s id), then POST https://graph.microsoft.com/v1.0/sites/{site-id}/permissions with the body {"roles": ["read"], "grantedToIdentities": [{"application": {"id": "<client_id>", "displayName": "Tranibor"}}]}. The call must be made by a caller that holds Sites.FullControl.All. PnP PowerShell does the same with Grant-PnPAzureADAppSitePermission -AppId <client_id> -DisplayName Tranibor -Site <site url> -Permissions Read.

Without step 2 the app is authorised and reads nothing: every site answers 403.

Use it when neither grant fits: a folder-level grant would break the site’s permission inheritance, and a site-wide application grant would bypass its restricted folders. The connector then signs in as a directory user, and reads only what that account may read, through its group memberships.

  1. Create a dedicated user, with no administrator role, and put it in the groups that give it read access. It needs a password that Microsoft Entra checks: an account federated to another identity provider usually cannot sign in this way.
  2. On the same app, API permissions, Add a permission, Microsoft Graph, Delegated permissions, Sites.Read.All, then Grant admin consent. Delegated, it opens nothing the account cannot already read; the “never” above is about the application permission.
  3. The account must have no interactive MFA requirement, because this sign-in cannot answer a challenge. Where you can, have a Conditional Access policy allow it only from the platform’s network location.

Microsoft discourages this sign-in (the password grant): use Sites.Selected wherever a per-site read fits.

  1. Administration, Connectors, Declare: capability Documents, type SharePoint, any name (it is lowercase, and knowledge sources refer to it).
  2. tenant_id: the Directory (tenant) ID. client_id: the Application (client) ID.
  3. client_secret: paste the secret’s Value in the password field. It is sealed and never shown again; to rotate it, use Replace.
  4. For a service account, fill username and type its password, sealed like the secret. Set both or neither: leaving both empty signs in as the application, and only one of them fails the sync.
  5. Leave graph_url and login_url alone unless you use a sovereign cloud.
  6. Then Knowledge, a base, Add source, SharePoint: pick this connector, the site (or a OneDrive’s drive) and, if you want, a folder.

This connector has no test button of its own. Add the source, then press Sync now: the source shows what it added and, if it failed, its last error. A first sync that lists documents proves the secret, the consent and the site grant at once.

  • AADSTS7000215 (invalid client secret): the Secret ID was pasted instead of the Value.
  • AADSTS700016 (application not found): wrong client_id, or wrong tenant_id.
  • 403 accessDenied on a site: the site grant (Permissions, step 2) is missing for that site or, with a service account, the account’s groups do not give it read access.
  • AADSTS50126 (service account): wrong user name or password. AADSTS50055: the password has expired. AADSTS50053: the account is locked.
  • AADSTS50076 or AADSTS50079 (service account): the account is asked for MFA, which this sign-in cannot answer. AADSTS53003: a Conditional Access policy blocks it.
  • AADSTS65001 (service account): the delegated Sites.Read.All has no admin consent.
  • 401 months after it worked: the client secret expired. Create a new one and Replace it.
  • A timeout: the API cannot reach graph.microsoft.com or login.microsoftonline.com; the network egress allowlist must open both.
Field What to put in it
client_id Application (client) ID, from the app’s Overview page
client_secret the secret’s Value (not its Secret ID), typed once
password the service account’s password, typed once; only with username, and without leading or trailing spaces
tenant_id Directory (tenant) ID, from the app’s Overview page
username optional: the service account’s user principal name, to sign in as it instead of the application

Hosts the platform must be allowed to reach:

  • graph.microsoft.com
  • login.microsoftonline.com