SharePoint and OneDrive
Where: Menu → Manage → Knowledge sources → Connectors → Add connector → “SharePoint and OneDrive”
This connector reads document libraries of SharePoint sites, and OneDrive folders, through Microsoft Graph. It signs in as an app registration of your own organisation in Microsoft Entra: the Academy never gets a person’s password, and it reads only what that app is allowed to read. After the first run it fetches only what changed.
What it brings along for each document: who may read it (Entra users and groups, links for the whole organisation, SharePoint site groups) and its sensitivity labels. People in the Academy then find only what they may read in SharePoint (see Access areas).
Who does what
Section titled “Who does what”| Step | Where | Who |
|---|---|---|
| Register the app, create its secret | Microsoft Entra admin center | An Application Administrator, Cloud Application Administrator or Global Administrator |
| Grant the read permission (admin consent) | Microsoft Entra admin center | A Privileged Role Administrator or Global Administrator |
| With “Sites.Selected”: allow the app on each site | Graph Explorer or PnP PowerShell | A SharePoint Administrator or Global Administrator |
| Add the connector and its sources | The Academy, Manage → Knowledge sources | An administrator of your organisation |
Knowledge sources must be allowed for your organisation by the platform and switched on (see Knowledge sources).
1. Register the app in Microsoft Entra
Section titled “1. Register the app in Microsoft Entra”-
Open the Microsoft Entra admin center (entra.microsoft.com) and sign in as one of the roles above.
-
Go to Identity → Applications → App registrations and click New registration.
-
Name: for example
Academy knowledge sources. Supported account types: “Accounts in this organizational directory only (single tenant)”. Leave Redirect URI empty. Click Register. -
The app’s Overview opens. Copy two values, you need them in the Academy:
- Directory (tenant) ID
- Application (client) ID
Both look alike (eight, four, four, four and twelve characters). Note which is which: swapped, the sign-in fails with “AADSTS90002: Tenant … not found”.
2. Create the client secret
Section titled “2. Create the client secret”- In the app, open Certificates & secrets → Client secrets → New client secret.
- Give it a description (for example
Academy) and choose how long it is valid (Microsoft allows up to 24 months). - Click Add and copy the Value right away. It is shown only now.
3. Grant the read permission
Section titled “3. Grant the read permission”- In the app, open API permissions → Add a permission → Microsoft Graph → Application permissions. (Not “Delegated permissions”: the connector reads without a signed-in person.)
- Choose one of these two:
| Permission | What the app may read | When to choose it |
|---|---|---|
| Sites.Selected | Only the sites you allow one by one (step 4) | Recommended: the Academy sees only the sites meant for training |
| Files.Read.All | Every SharePoint site and every OneDrive in your organisation | When you want many sites or OneDrives, or when changes aren’t picked up with Sites.Selected in your tenant |
- Optional: also add InformationProtectionPolicy.Read.All. The Academy then shows the names of your sensitivity labels (“Confidential – HR”) instead of their ids.
- Click Grant admin consent for
and confirm. The status column must show a green tick “Granted”. Without the consent nothing works, even though the permission is listed.
4. With Sites.Selected: allow the app on each site
Section titled “4. With Sites.Selected: allow the app on each site”With Files.Read.All, skip this step.
With Sites.Selected, the app may read no site until it is allowed on it. Do this for every site you want to connect. Two ways:
In Graph Explorer (nothing to install)
Section titled “In Graph Explorer (nothing to install)”-
Open Graph Explorer (developer.microsoft.com/graph/graph-explorer) and sign in as a SharePoint Administrator or Global Administrator. Graph Explorer asks to consent to Sites.FullControl.All for itself; you can give it under “Modify permissions”.
-
Find the site’s id: choose GET and enter
https://graph.microsoft.com/v1.0/sites/contoso.sharepoint.com:/sites/Handbook(your host name and the site’s path). Click Run query and copy theidfrom the answer. -
Allow the app: choose POST, enter
https://graph.microsoft.com/v1.0/sites/<site id>/permissionsand as Request body:{"roles": ["read"],"grantedToIdentities": [{ "application": { "id": "<Application (client) ID>", "displayName": "Academy knowledge sources" } }]}Click Run query. The answer “201 Created” means the app may now read that site.
With PnP PowerShell
Section titled “With PnP PowerShell”If you already use PnP PowerShell, signed in with Connect-PnPOnline to your SharePoint admin site:
Grant-PnPAzureADAppSitePermission -AppId <Application (client) ID> -DisplayName "Academy knowledge sources" -Site https://contoso.sharepoint.com/sites/Handbook -Permissions ReadNewer PnP PowerShell versions call the command Grant-PnPEntraIDAppSitePermission, with the same parameters.
5. Add the connector in the Academy
Section titled “5. Add the connector in the Academy”- Open Manage → Knowledge sources, tab Connectors, and click Add connector.
- Kind: “SharePoint and OneDrive”.
- Where it runs:
- Run by the portal (recommended): nothing to install. The secret is stored encrypted with your organisation’s key. If this choice is greyed out with “Not available for this connector or on this portal”, the platform hasn’t switched on running connectors; ask the platform’s administrators, or run it at your organisation.
- At your organisation: the connector runs in your own network and the secret never leaves it (see Connectors). Microsoft 365 is in the cloud, so this is only needed if your rules say secrets must stay in-house.
- Name: for example
SharePoint HR. Empty, the kind’s name is used. - Fill in:
- Directory (tenant) ID and Application (client) ID from step 1;
- Client secret from step 2. At your organisation, this field says “Set where the connector runs (CONNECTOR_CLIENT_SECRET)”: you give the secret to the connector there, not in the browser.
- Click Add. Run by the portal, the connector shows Online at once. At your organisation, the token window opens; start the connector with it.
- Click Test on the connector. “Works:
· Sites.Selected” (or “Files.Read.All”) means the sign-in works and the permission is there. The test does not yet try a site: that happens when you browse in the next step.
6. Add a source per site or OneDrive
Section titled “6. Add a source per site or OneDrive”A connector is the sign-in; a source is one library (or a folder in it) that is read. Add as many sources as you like to one connector.
- Tab Sources → Add source.
- Connector: the one you just added. Name: for example
HR handbook. - Either SharePoint site: the site’s address as you open it in the browser, e.g.
https://contoso.sharepoint.com/sites/Handbook(just the site, without/Shared Documents/…or/SitePages/…). Or OneDrive of: the sign-in address of the person whose OneDrive is read, e.g.anna.berg@contoso.com. Leave SharePoint site empty then. OneDrive needs Files.Read.All. - Library and folder: click Browse…. The first level lists the site’s document libraries (“Documents”, “Policies” …); click Open to go into one and its folders, then Choose this folder (or Choose on a library to read all of it).
- Include and Leave out (one pattern per line): by default PDF, Word, PowerPoint, Excel, Markdown, text and HTML files are read, and Office’s lock files (
~$…) are left out.**means any folders,*any name,{a,b}either. Example:**/Archive/**under Leave out skips every “Archive” folder. - Choose What leaves the source, For whom, the Topics of the course factory and the Sync interval, then Save (see Sources).
- Click Sync now on the source, or wait for the first sync. The tab Documents fills as files are read.
What happens then
Section titled “What happens then”- Changes: after the first sync only changes are fetched (Microsoft Graph’s delta query), at the interval you chose. Where the platform’s portal is reachable from the internet, the connector also subscribes to changes of each library and syncs them within a minute; nothing to set up for that.
- Deleted in SharePoint: a deleted file leaves the Academy’s knowledge at the next sync.
- Another folder or other patterns: the next sync reads the whole library again, so files the new patterns take in arrive even if they didn’t change.
- Searching live (Documents → Search the sources live): Microsoft Graph’s search is not open to an app with only Sites.Selected. The connector then finds files by their names in the source’s folder and its subfolders instead (within 10 seconds); with Files.Read.All or Sites.Read.All Graph’s search finds words inside the files too.
- Permissions: who may read a file comes from SharePoint. Entra users and groups are matched with your people automatically (through the company sign-in with Microsoft). SharePoint site groups (“Owners”, “Members”, “Visitors” of a site) can’t be looked into by an app: give them to teams under Access areas. A file with permissions that name no one the Academy can match waits under Review.
- Sensitivity labels (Microsoft Purview) arrive as labels. Under Access areas you decide which of them restrict reading.
- Originals stay in SharePoint. The Academy keeps only what it derives: passages, summary, categories and the link back. In a document’s window, the link under Original opens the file in SharePoint, where SharePoint checks the person’s own permissions; View original fetches it live through the connector to show it once, without keeping it.
When something doesn’t work
Section titled “When something doesn’t work”The connector’s Test, Browse… and the source’s last sync show the connector’s own message. In the Academy it reads, for example, “The source refused the connector’s access. Check its credentials and permissions. Details: Microsoft sign-in failed: AADSTS7000215: …”. Look up the part after Details:. The most common ones:
| Message | Cause | What to do |
|---|---|---|
| Microsoft sign-in failed: AADSTS7000215 | The secret is wrong, often the Secret ID instead of the Value | Create a new secret (step 2), copy the Value, enter it under Settings |
| Microsoft sign-in failed: AADSTS7000222 | The secret has expired | Create a new secret and enter it under Settings |
| Microsoft sign-in failed: AADSTS700016 | The Application (client) ID isn’t found in this directory | Check the client ID and the directory ID (both from the app’s Overview); often the two are swapped |
| Microsoft sign-in failed: AADSTS90002 | The directory (tenant) ID doesn’t exist: most often the two IDs are swapped, the Application (client) ID sits in the directory field | Copy the Directory (tenant) ID again; it is the second value in the Overview, under the Application (client) ID |
| the app has no Microsoft Graph permission to read files | Admin consent missing, or a delegated instead of an application permission | Step 3: application permission, then Grant admin consent; Microsoft can take a few minutes to apply it, then click Test again |
| Microsoft Graph refused access: grant the app read access to this site | Sites.Selected without step 4 for this site | Allow the app on the site (step 4) |
| not found in Microsoft 365 (site, library, folder or person) | The site address, folder or OneDrive address is wrong, or the folder was moved | Open the address in the browser; pick the folder again with Browse… |
| give a SharePoint site or the person whose OneDrive is read | Both fields of the source are empty | Fill in SharePoint site or OneDrive of |
| pick a document library | Library and folder wasn’t chosen | Click Browse… and choose a library |
| Microsoft Graph refused the change subscription | Change notifications can’t be set up; syncing still works at the interval | Nothing; changes arrive at the next sync |
Microsoft limits how fast an app may read (throttling). The connector waits as long as Microsoft asks and goes on by itself; a very large library just takes longer the first time.
Renew the secret
Section titled “Renew the secret”- In Entra, create a new client secret (step 2) before the old one expires.
- In the Academy, click Settings on the connector, paste the new value under Client secret and click Save (at your organisation: set the new
CONNECTOR_CLIENT_SECRETand restart the connector). - Click Test. Then delete the old secret in Entra.
Disconnect
Section titled “Disconnect”- To stop one library: Pause the source, or Delete it (everything derived from it is deleted; nothing in SharePoint is touched).
- To stop everything: Delete the connector (its sources and what was derived go too), then delete the app registration in Entra.