All connectors

Storage

Microsoft SharePoint

Microsoft SharePoint Connector

Index a SharePoint library or a personal OneDrive through Microsoft Graph, after a web login: pick the site, then the folders.

Prerequisites

  • A Microsoft work or school account with access to the site
  • A Microsoft Entra application with `Sites.Read.All`, `Files.Read.All`, `User.Read` and `offline_access`
  • `MICROSOFT_CLIENT_ID`, `MICROSOFT_CLIENT_SECRET` and `MICROSOFT_REDIRECT_URI` set on the server

Data ingested

When you connect Microsoft SharePoint, the following content becomes searchable. Every answer that uses it cites it.

ContentWhat is kept
DocumentsWord, PDF, PowerPoint, Excel, Markdown, text, CSV, JSON and HTML files, subfolders included
Modification dateKept so an unchanged file is not re-indexed
Personal spaceThe account OneDrive is offered as a site of its own: on a new tenant the team site libraries are empty while the personal drive holds the files

Setup

Configuration happens in the dashboard, under Integrations. No API call is needed for a normal setup.

1

Register the application

Entra ID → App registrations → API permissions: add `Sites.Read.All` and `Files.Read.All` (application or delegated), then grant admin consent. Create a client secret.

2

Configure the server

Set `MICROSOFT_CLIENT_ID`, `MICROSOFT_CLIENT_SECRET`, `MICROSOFT_REDIRECT_URI` and optionally `MICROSOFT_TENANT` (`organizations` by default) in the service environment, then restart the API.

3

Connect the account

Integrations → Add source → Microsoft SharePoint, then **Connect**: the Microsoft consent page opens and returns to `/auth/microsoft/callback`.

4

Choose the site

**Choose a site** lists what the account can open. A site whose library is not readable is refused with an explicit message rather than accepted and failing later.

5

Choose the folders

The folder browser lists the library level by level. Folders and individual files are both selectable; an empty selection indexes the whole library.

Where the credential goes
There is no token to paste: the connection is a **web login**. **Connect** opens the Microsoft consent page, the server exchanges the code, and stores the **refresh token** as the source secret — an access token would expire after an hour and break the scheduled sync. The redirect URI declared in Entra must match `MICROSOFT_REDIRECT_URI` exactly, otherwise Microsoft answers `AADSTS50011`.

Configuration options

FieldDescriptionRequired
SiteSharePoint site, or **Mon espace (OneDrive)** for the personal drive. Required before browsingYes
FolderStarting folder inside the library. Empty means the library rootNo
FilesIndividual files picked in the browser, taking precedence over the folderNo

Best practices

  • •Pick a library you actually own: `sites?search=*` also returns sites the account can see without being able to open their drive, and those are refused at selection.
  • •On a fresh tenant the team site libraries are often empty — start with **Mon espace (OneDrive)**, where the account files live.
  • •Keep the redirect URI identical between Entra and the server environment: Microsoft compares the two strings at both steps of the flow.

Troubleshooting

`AADSTS50011`

The redirect URI sent to Microsoft does not match the one declared in Entra. Set `MICROSOFT_REDIRECT_URI` to the exact registered value and restart the API.

`AADSTS90002` — tenant not found

`MICROSOFT_TENANT` holds a directory id that does not resolve. Use `organizations` (any work or school account) or the exact tenant domain.

`SharePoint : le jeton n'a pas accès à cette ressource`

Microsoft Graph answered 403: the account has no access to that site library. Choose another site, or the personal space. The site is now checked before it is saved.

`MICROSOFT_CLIENT_ID et MICROSOFT_CLIENT_SECRET ne sont pas configurés`

The server environment lacks the Entra credentials. Add both variables and restart the API.

Nothing indexed

The library holds only unsupported formats, or the chosen folders are empty. The sync reports how many files were skipped for lack of extractable text.

Next steps

Once the source is connected and indexed, ask a question from the chat and check that the answer cites this source. A source that never appears in a citation is usually a source with nothing indexed: see Troubleshooting above.