---
title: "Search Microsoft 365 content from Sofi"
site: admin
version: 2027.1
versions: "all"
url: https://docs-new.servicely.ai/admin/2027.1/sofi/assistants/search-microsoft-365-content/
type: task
application: sofi_core
last_updated: 2026-12-03
commit: 6777698daac5
---


Set this up when you want Sofi's assistants to answer from SharePoint, OneDrive for Business and Microsoft 365 connector content. Searches use the Microsoft Graph Copilot Retrieval API with each user's own delegated token, so users only find what they can already open in Microsoft 365.

<Callout type="info">
  **Changed in 2027.1.** The search works as before. AI Self-Service, which holds the Self-Service Assistant, is no longer installed by default.
</Callout>

## Before you begin

- You need the `administrator` role in Servicely, and rights to register applications and grant admin consent in Microsoft Entra ID.
- Users need Microsoft 365 Copilot licences. The Copilot Retrieval API requires them.
- Users should sign in to Servicely through Microsoft Entra ID single sign-on, so their tokens are captured at sign-in.

## Steps

<Steps>
  <Step>
    In the Azure portal, open **Microsoft Entra ID → App registrations** and select or create the registration for Servicely.
  </Step>
  <Step>
    Under **API permissions**, add these delegated permissions and grant admin consent: `Files.Read.All`, `Sites.Read.All`, `offline_access`, and `ExternalItem.Read.All` if you search connector content.
  </Step>
  <Step>
    Under **Authentication**, add the redirect URI `https://<instance>.servicely.ai/sso/oauth_callback`. It must match the **Redirect URL** field in the next step exactly. Under **Certificates & secrets**, note the client ID and create a client secret.
  </Step>
  <Step>
    In Servicely, in the **Administration** workspace, go to **Integrations → API access → System OAuth providers** and select **New**. Fill in the record as the table shows, and save.

    | Field | Value |
    | --- | --- |
    | **Name** | A name you will reference later, for example `ms-graph-copilot` |
    | **Client ID** | The application (client) ID of the registration |
    | **Client Secret** | The client secret |
    | **Authorization URL** | `https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize` |
    | **Token URL** | `https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token` |
    | **Redirect URL** | `https://<instance>.servicely.ai/sso/oauth_callback` |
    | **Scopes** | `https://graph.microsoft.com/.default`, which is also used when the field is empty |
    | **Grant type** | Authorization Code |

    <Image src="asset:screenshots/admin/sofi-assistants-search-microsoft-365-content/oauth-providers-menu.png">The System OAuth providers item in the Integrations menu.</Image>

    <Image src="asset:screenshots/admin/sofi-assistants-search-microsoft-365-content/new-oauth-provider.png">The empty Create System OAuth Provider form, with Client ID, Client Secret, Grant type and the URL fields.</Image>
  </Step>
  <Step>
    Go to **Access & security → Authentication → Identity provider** and open your Microsoft Entra ID provider. Add the new OAuth provider to **OAuth Providers** and save. Servicely now stores each user's Microsoft tokens when they sign in.
  </Step>
  <Step>
    Set the application property `microsoft.search.oauth.provider.name` to the **Name** of the OAuth provider.
  </Step>
  <Step>
    Give the assistants that should search Microsoft 365 a tool that uses it, such as (Knowledge) Search SharePoint/CoPilot (Self-Service). The shipped Self-Service Assistant already has it, once AI Self-Service is installed. AI Knowledge Management ships its own (Knowledge) Search SharePoint/CoPilot tool.
  </Step>
</Steps>

## Result

When a user signs in through Microsoft Entra ID, Servicely saves their access and refresh tokens as a System API outbound token linked to the user and the OAuth provider. Tokens refresh automatically when they expire.

When an assistant searches, Servicely queries SharePoint, OneDrive for Business and connector items in one batched call. It returns the five most relevant extracts to the assistant by default. A source that returns an error, for example because the user has no access, is skipped and the other results are still returned. A user with no stored token sees a "Connect your Microsoft account" link that starts the Microsoft consent flow.

Tokens are stored encrypted, and the search never uses application-only credentials.

## Related

- [Troubleshoot Microsoft 365 search](page:sofi/assistants/troubleshoot-microsoft-365-search)
- [AI tools](page:sofi/assistants/ai-tools)
- [Set up single sign-on with Microsoft Entra ID](page:access/sign-in/sso-microsoft-entra-id)
- [Sofi data handling and security](page:sofi/data-handling)
