Skip to main content
Import Word, PowerPoint, Excel, PDF and other documents from a SharePoint site. The connector keeps the folder hierarchy and extracts the text of each file for your agents.

Supported File Types

The connector extracts text from these formats:
  • Office documents: .docx, .docm, .doc, .pptx, .ppt, .xlsx, .xls
  • PDFs: .pdf
  • OpenDocument: .odt, .odp, .ods, .rtf
  • Plain text: .txt, .md, .csv, .json, .xml, .html
  • Other: .epub
In PDF, Word and PowerPoint files, images such as diagrams, charts and screenshots are described in text, so agents can answer from what they show, and stored with the document when possible. PowerPoint .pptx imports also include chart data and speaker notes. Files larger than 50 MB are skipped. Files of other types appear in the tree without content.

Choose a permission mode

AGO supports two ways to grant access to SharePoint, set in Knowledge > Sources > Connections > SharePoint: Both modes share the rest of the setup (Tenant ID, Client ID, Client Secret).

Setup — All sites mode (simple)

1

Register an app in Microsoft Entra ID

  1. Go to the Azure Portal > Microsoft Entra ID > App registrations > New registration
  2. Give it a name (e.g. “AGO SharePoint Connector”)
  3. Choose Single tenant (or Multitenant if you serve multiple Microsoft tenants)
2

Add API permissions

Under API permissions > Add a permission > Microsoft Graph > Application permissions, add:
  • Sites.Read.All
  • Files.Read.All
Then click Grant admin consent.
3

Create a client secret

Under Certificates & secrets > New client secret, generate a secret and copy its Value (you can only see it once).
4

Configure AGO

In AGO, go to Knowledge > Sources > Connections > SharePoint, select All sites (simple), and paste:
  • Tenant ID
  • Client ID
  • Client Secret
Click Test Connection and then Save Configuration.
5

Create a knowledge source

  1. Go to Knowledge > Sources and click Create New Source
  2. Select sharepoint as the Source Type
  3. Pick a site from the SharePoint Site list
  4. Optionally pick a Document Library and a folder, or leave them empty to import the default library
  5. Click Save, then open the source and click Sync Source

Setup — Selected sites mode (limited scope)

In this mode AGO can only access the SharePoint sites your admin has explicitly granted. Microsoft Graph does not return the list of granted sites, so you list them in AGO’s settings.
1

Register an app in Microsoft Entra ID

Same as the all sites mode: create an app registration in Azure Portal > Microsoft Entra ID > App registrations.
2

Add API permissions

Under API permissions > Add a permission > Microsoft Graph > Application permissions, add only Sites.Selected.Then click Grant admin consent. At this stage AGO is not yet able to read any site — Sites.Selected only gives the capability to be granted access on a per-site basis. Once a site is granted, it covers the site’s document libraries and file contents.
Files.Read.All and Sites.Read.All are not needed in this mode. They let the app read every site and every OneDrive of your tenant, whatever sites you select.
3

Create a client secret

Under Certificates & secrets > New client secret, generate a secret and copy its Value.
4

Configure AGO

In AGO, go to Knowledge > Sources > Connections > SharePoint, select Selected sites (limited scope), and paste the Tenant ID, Client ID, and Client Secret. Click Save Configuration.
5

List the sites and grant access

  1. In Knowledge > Sources > Connections > SharePoint, under Granted SharePoint sites, add each site URL AGO may read (e.g. https://contoso.sharepoint.com/sites/Marketing).
  2. Click Grant access with Microsoft and sign in with an account that is a SharePoint Administrator and a member of each listed site.
  3. The first time, Microsoft asks a Global Administrator to approve the AGO – SharePoint site access app for your organization.
AGO saves your configuration, grants your app read access to every listed site, and shows the result next to each URL: Access OK, Not granted, Site not found, or Check failed when Microsoft could not be reached. Click Check access to test again. Sites that already have access are left unchanged, so you can click the button again after adding a new site.AGO only uses this sign-in to grant read access to the listed sites, for the Client ID you configured. It does not keep the sign-in.If the Grant access with Microsoft button is not shown, or your organization does not allow the approval, grant each site manually.
6

Add restricted folders (optional)

A folder whose access is limited to some people (it no longer follows the site permissions) stays hidden from AGO, even when its site is granted. To let AGO read one:
  1. Under Restricted folders, add the folder address. You can copy it from the browser while the folder is open in SharePoint (e.g. https://contoso.sharepoint.com/sites/Marketing/Shared Documents/Contracts). The folder must be inside one of the listed sites.
  2. Click Grant access with Microsoft. The account you sign in with must have access to the folder.
AGO grants itself read access to each listed folder that has its own permissions. A folder that still follows the site permissions is left unchanged, since the site access already covers it. Each folder shows Access OK, Not granted or Not in a listed site, like the sites above it.Only list the restricted folders AGO should read: their content becomes available to the agents that use this source.
7

Create a knowledge source

  1. Go to Knowledge > Sources and click Create New Source
  2. Select sharepoint as the Source Type
  3. Pick a site from the SharePoint Site list (it shows the granted sites)
  4. Pick a Document Library, then browse the folder tree to choose where the import starts
  5. Click Save, then open the source and click Sync Source

Grant access manually

For every SharePoint site you want AGO to read, a SharePoint admin runs the following Microsoft Graph call with a token that has the Sites.FullControl.All application permission, then adds the site URL under Granted SharePoint sites in AGO. Before running the commands, gather these values:
Alternatives: PnP PowerShell Grant-PnPAzureADAppSitePermission or the CLI for Microsoft 365. For a restricted folder, the equivalent call is POST https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}/permissions with the body {"roles": ["read"], "grantedToV2": {"application": {"id": "YOUR_AGO_CLIENT_ID", "displayName": "AGO"}}}. Granting a folder that still follows the site permissions breaks its inheritance, so only do it for folders that already have their own permissions.

Configuration Options

What Gets Imported

  • Each folder becomes a parent document
  • Each file becomes a child document with its extracted text content
  • Each document links to the original item, so users can open it in SharePoint
  • Each document keeps the file’s extension, size and path
  • The original file can be downloaded through the API, without a SharePoint account: see Download a document’s original file

Troubleshooting

  • Verify the Tenant ID is the actual tenant GUID, not common
  • Check that the Client Secret is the secret value (not the secret ID)
  • If the secret is older than its expiration date, generate a new one
  • Check that admin consent has been granted for the API permissions
AGO has not been granted access to this site. Click Grant access with Microsoft in Knowledge > Sources > Connections > SharePoint, or send the curl command shown in AGO to your Microsoft 365 admin. After the grant runs, click Test access again. If you keep seeing 403:
  • Verify the application id in the grant matches your AGO Client ID
  • Verify the site URL in the grant request is identical to the one you paste in AGO
  • Some tenants take a few minutes for new grants to propagate
If the sign-in itself fails, no site is granted:
  • Microsoft refused the sign-in: a Global Administrator must first approve the AGO – SharePoint site access app for your organization.
If the sign-in succeeds but some sites fail, the other sites are still granted:
  • Refused: the account you signed in with must have the SharePoint Administrator role and be a member of each site. Add it as a member of the site, then click the button again.
  • Site not found: check the URL. Use the site address (e.g. https://contoso.sharepoint.com/sites/Marketing), not a link to a document or a page.
  • Not in a listed site: a restricted folder must be inside one of the sites listed under Granted SharePoint sites. Add its site, then click the button again.
  • In All sites mode, confirm the app has Files.Read.All granted in addition to Sites.Read.All
  • Check the configured folder path actually exists in the library
  • In Selected sites mode, confirm the site has been granted to AGO (its badge shows Access OK)
  • In Selected sites mode, AGO cannot read a folder with limited access until you add it under Restricted folders and grant it
The file type is not in the supported list. The file appears in the tree but its content is not imported.