Skip to main content

Set up real-time access for SharePoint

Data fetching supplements indexed SharePoint results with real-time content from Microsoft 365. Users can find recently created or updated content without waiting for the next crawl. It doesn't change the crawl schedule.

Sensitivity-label exclusions

Sensitivity-label indexing exclusions don't apply to Data fetching. Content excluded from indexing by a label can still appear in real-time results if the user has access to it in Microsoft 365. If your organization relies on these exclusions, review this limitation with your security team before enabling real-time access. See Restrict O365 content via sensitivity labels.

How real-time access works​

Real-time access retrieves content live from SharePoint when a query targets this source. This applies to the following Glean surfaces:

Any query that specifies app:sharepoint, or search results explicitly filtered for SharePoint, can include real-time results alongside indexed results.

Assistant and agents​

When Assistant or an agent is highly confident that a query is about SharePoint (for example, when the user mentions SharePoint or includes a link), it adds real-time search results from that source to the chat context.

Explicitly specifying app:sharepoint in a query or agent run also triggers real-time results. Assistant and agents can also scope real-time results to a specific SharePoint site, list, document library, or folder.

Supported content​

Real-time access supports the following content types:

SourceSupported content
SharePointDocuments, site pages (classic and modern page libraries), lists

Glean also supports native file access for Microsoft Excel (.xlsx) files stored in SharePoint. When native file access is available, Assistant and agents can read the original spreadsheet rather than extracted text, preserving formatting, formulas, and structure.

note

Attachments and images within SharePoint lists and pages are not included in real-time results.

When you paste a SharePoint link into Glean, Glean reads the document, site page, or list that the link points to. Links to folders and document libraries aren't read as content, because they point to a container of files rather than to a file. To ask about a file in a folder or document library, paste the link to that file instead.

Enable real-time access​

Native real-time access uses delegated permissions on the default SharePoint app used for indexing. Configure these permissions and the redirect URI on that app, not on additional crawler apps.

This user connection is separate from the central or custom OAuth configuration for read and write tools. Connecting tools does not replace each user's native SharePoint authorization.

Reauthorize when permissions change

If a connection was authorized before the required delegated scopes were added, its token may not include them. Complete any Reconnect prompt for the affected connection, and have users reauthorize their SharePoint connection when prompted. Do not recreate working connections or reconnect unrelated apps.

Which setup do you have?

If SharePoint was connected through the previous setup, an administrator enables real-time search separately. The new setup enables real-time search without a checkbox. Both paths require the delegated permissions, native OAuth redirect URI, and end-user connection described here. If you completed the app configuration during setup, continue at Authenticate end users.

Enabling real-time access requires both administrator setup and end-user authentication:

  • Configuring your Admin console and Azure portal
  • Having end users authenticate

Configure the Admin console and Azure portal​

For the previous setup, a Glean administrator enables data fetching. Both setups need the delegated permissions and redirect URI on the default app. Use the Microsoft 365 Global Administrator role for the Azure steps in this guide.

Enable data fetching in the Admin console​

Complete this step only for the previous setup. The new setup enables data fetching without a checkbox.

  1. Navigate to Admin console → Connectors.
  2. Select SharePoint.
  3. Go to the Setup tab.
  4. Select the checkbox to enable data fetching.

Configure delegated permissions in Azure​

As a Microsoft 365 Global Administrator, add delegated permissions to the default SharePoint app. See About admin roles in the Microsoft 365 admin center.

  1. Sign in to the Azure portal.
  2. Open the app registration whose client ID is configured for the default SharePoint app in Glean.
  3. Select Manage → API permissions.
  4. Select Add a permission, then select Microsoft Graph.
  5. Choose Delegated permissions and add the following:
    • offline_access
    • User.Read
    • Files.ReadWrite.All
    • Sites.Read.All
tip

Grant Files.ReadWrite.All so Glean can access files from shared URLs. See Microsoft's Accessing shared driveItems documentation for details.

info

These delegated permissions are separate from the application permissions used for crawling. They enable per-user, on-demand access to content that may not yet be indexed.

Grant admin consent for the permissions where required. If they were added after users authorized SharePoint, users may need to authorize again to obtain tokens with the updated scopes.

Configure the OAuth redirect URL​

Use the native SharePoint redirect URI shown in the Admin console setup instructions:

  1. In the Azure portal, open the default SharePoint app and select Authentication → Add a platform → Web.

  2. Copy the redirect URI from the SharePoint setup instructions in Glean. It follows this pattern:

    https://<your-company-be.glean.com>/instance/o365/oauth/verify_code
  3. Add that exact URI and click Configure.

Do not use the backend domain alone or substitute the tools callback ending in /tools/oauth/verify_code. Additional crawler apps do not need this native real-time OAuth redirect URI.

note

These instructions apply to the standard Azure Portal App Authentication experience, not the preview experience.

Authenticate end users​

After the admin configuration is complete, each user must authenticate with SharePoint to use real-time access:

  • Proactively: Users navigate to Your Settings > Connectors and select SharePoint to authenticate.
  • On demand: Glean prompts users to authenticate when a query includes a link to a document that Glean has not indexed yet.

Consider communicating to your organization that real-time access is available and encouraging users to authenticate.

How crawl restrictions apply​

Real-time access respects the same crawl restrictions that govern SharePoint indexing. Glean validates every real-time result against your configured restrictions before returning it to the user.

Site restrictions​

Glean checks each real-time result against the site Inclusion and Exclusion rules configured in the Admin console:

  • Inclusion rules: When site Inclusion rules are configured, only results from included sites appear in real-time results. Content from sites that aren't included is excluded.
  • Exclusion rules: Content from excluded sites is excluded from real-time results.

These checks apply to both real-time search results and content that Assistant or agents fetch on demand. If Glean can't determine which site a result belongs to, that result is also excluded as a safety measure.

Search visibility (NoCrawl)​

Real-time access also honors SharePoint's search visibility settings. SharePoint applies search visibility at the site level and the container level, where containers are lists, site pages, and document libraries. SharePoint has no item-level search visibility setting.

Because Glean serves real-time results under each user's own Microsoft 365 permissions, SharePoint's permission and search visibility rules apply automatically. If search visibility is turned off for a site or container, its items don't appear in that user's real-time results.

note

Search visibility is evaluated at request time, so it reflects the current state of SharePoint's search index rather than a cached snapshot.

Troubleshooting​

Admin console shows a Reconnect prompt after enabling SharePoint real-time access​

A connection authorized before a permission change may have a token without the required scopes. Check whether the prompt is for the native SharePoint connection or the separate tools connection.

  1. Verify the delegated permissions on the app used by the affected connection.
  2. Complete its Reconnect prompt and the Microsoft consent flow.
  3. For native real-time access, have the affected user authorize SharePoint under Your Settings → Connectors when prompted.

Reconnecting tools alone does not authorize native SharePoint access for users.

SharePoint real-time crawl or sync fails with insufficient-scope errors​

If native real-time requests fail with insufficient-permission or missing-scope errors, check the app permissions and the affected user's authorization:

  1. In Azure, verify that the default SharePoint app includes these delegated Microsoft Graph permissions:
    • offline_access
    • User.Read
    • Files.ReadWrite.All
    • Sites.Read.All
  2. Grant admin consent where required and confirm the native redirect URI is configured.
  3. Have the affected user reauthorize SharePoint under Your Settings → Connectors when prompted, then retry the request.

If the error continues, confirm that you updated the app whose client ID is configured for SharePoint. Updating only the separate tools app does not resolve native real-time permissions.

Expected content doesn't appear in real-time results​

If a SharePoint item you expect to see isn't showing up in real-time results, a crawl restriction may be excluding it:

  1. Check site restrictions: In the Admin console, verify that the item's site isn't on the Exclusion list. If you're using Inclusion rules, confirm the site is included.
  2. Check search visibility: In SharePoint, verify that the library or list containing the item has search visibility enabled. Items in libraries or lists with search visibility turned off are excluded from real-time results.

Frequently asked questions​