Index content from SharePoint in Microsoft 365

Note

Foundry IQ (Azure AI Search) provides direct indexing and query APIs alongside higher-level knowledge source and knowledge base APIs for managed retrieval. Use the Azure portal, REST APIs, or Azure SDKs to configure these capabilities, or connect agents to knowledge bases in the Microsoft Foundry portal.

For terms that apply when you connect to external data sources, see External data sources.

The SharePoint in Microsoft 365 indexer imports files, list items, and modern site pages into Foundry IQ. It's generally available with the 2026-10-01 REST API. This article uses that version for the configuration steps, followed by behaviors and scenarios.

For layout-aware extraction and chunking of supported documents, see Extract and enrich SharePoint documents in Foundry IQ. Use the knowledge source APIs for simpler setup, or configure the indexer and skillset directly for more control.

In Foundry IQ, an indexer extracts searchable data and metadata from a data source. The SharePoint in Microsoft 365 indexer provides the following functionality:

  • Indexes files and metadata from one or more document libraries.
  • Indexes SharePoint lists and their item field values, with each list column available as a source field for field mapping.
  • Indexes ASPX site pages (modern site pages).
  • Indexes mixed SharePoint content (document libraries, lists, and site pages) in a single indexer using the allSiteContent container value.
  • Indexes content across subsites when includeSubsites=true is set in the data source query.
  • Indexes incrementally, picking up just the new and changed files, list items, pages, and metadata.
  • Detects deleted content automatically. Deletion of files, list items, or pages is picked up on the next indexer run, and the corresponding search document is removed from the index.
  • Extracts text and normalized images from indexed documents automatically. Optionally, you can add a skillset for deeper AI enrichment, such as optical character recognition (OCR) or entity recognition.
  • Supports document-level permission ingestion. See the linked article for the supported permission subset, group resolution, and permission synchronization.
  • Supports Microsoft Purview sensitivity label ingestion and honoring at query time. This functionality is in preview.

Prerequisites

Choose your permissions setup

Before you create the app registration in Step 3, identify your scenario in the following table. Note the required Microsoft Graph permissions, SharePoint API permissions, and credential type. Then, follow the linked steps later in this article to apply them.

Scenario Microsoft Graph permissions SharePoint API permissions Credential Apply in
Index document libraries only, no ACL ingestion Files.Read.All, Sites.Read.All (application) or delegated equivalents None Client secret (application) or device code (delegated) Step 3, Step 6
Index lists, ASPX pages, or mixed content (no ACL ingestion) Files.Read.All, Sites.Read.All (application) None Client secret or federated credential Step 3
ACL ingestion or query-time resolution of SharePoint site groups See the ACL permission matrix. See the ACL permission matrix. See the ACL permission matrix. Permissions by ACL scenario

When setting up permissions, consider the following information:

  • Delegated permissions are only viable for small testing and don't support ACL ingestion.
  • Federated credential is the recommended secretless authentication. It covers both indexer authentication and query-time SharePoint group resolution.
  • When you use Sites.Selected, grant the app explicit access to each target SharePoint site before indexing. Admin consent for Sites.Selected in Microsoft Entra ID doesn't by itself authorize the app to access site content. You must also assign a permission on each target site. If you add a site to the data source without an explicit site permission grant, the indexer fails. See Grant site access when using Sites.Selected.

Application permissions for ingestion don't establish an end user's query permissions. In a user-facing permission-filtered application, Authorization authenticates the caller to Search, while x-ms-query-source-authorization supplies the user's permission context. See query-time permission enforcement.

An application token represents the application, not a signed-in user. The Microsoft identity platform on-behalf-of flow supports only user principals. Don't use an app-only token as a user assertion for that flow.

Supported document formats

The SharePoint in Microsoft 365 indexer can extract text from the following document formats:

  • CSV (see Indexing CSV blobs)
  • EML
  • EPUB
  • GZ
  • HTML
  • JSON (see Indexing JSON blobs)
  • KML (XML for geographic representations)
  • Markdown
  • Microsoft Office formats: DOCX/DOC/DOCM, XLSX/XLS/XLSM, PPTX/PPT/PPTM, MSG (Outlook emails), XML (both 2003 and 2006 WORD XML)
  • Open Document formats: ODT, ODS, ODP
  • PDF
  • Plain text files (see also Indexing plain text)
  • RTF
  • XML
  • ZIP

Limitations and considerations

Here are the limitations of this feature:

  • OneNote notebook files aren't supported.

  • Incremental indexing limitations:

    • Renaming a SharePoint folder breaks incremental indexing. A renamed folder is treated as new content.

    • The indexer can reprocess previously indexed documents even when their content hasn't changed. This behavior is by design and helps avoid missing changes and preserve data integrity. Reprocessing can occur during recovery from transient errors in the source system or when Microsoft 365 processes update SharePoint metadata. These internal events might not be visible through customer-facing document properties.

      Depending on your pipeline configuration, reprocessing can invoke downstream services again, including AI enrichment and embedding generation. Account for this additional processing when planning indexing time, capacity, and costs. For troubleshooting, see Understand synchronization retries.

  • Security limitations:

  • SharePoint group permission resolution has a five-site-URL limit per index when the site-context field is marked with sharepointSiteUrl: true. This limit doesn't apply to every permission configuration. If you need SharePoint group permissions across more sites, evaluate separate indexes and indexed knowledge sources. See Plan topology for SharePoint group permissions.

  • Document libraries, lists, and modern-page sources have separate indexing scope defaults. These count selected sources, not individual files, list items, or pages.

Here are some considerations when using this feature:

Regardless of the approach you choose, whether building a custom connector with SharePoint webhooks or creating an Azure Logic Apps workflow, be sure to implement robust security measures. These measures include setting up firewalls and preserving user permissions from the source and honoring those permissions at query time. You should also regularly audit and monitor your pipeline.

For SharePoint ACL ingestion, Microsoft Entra groups nested within SharePoint groups are supported up to five nested levels. A separate site-level principal limit also applies. See Supported group relationships for configuration requirements and the limit.

Plan your indexing topology

For a directly configured pipeline, the resources have separate responsibilities:

Resource Responsibility
Microsoft Entra application and SharePoint site grants Authorize ingestion access to the selected content. When using Sites.Selected, grant access to each selected site.
Data source Defines the connection and selects sites, libraries, lists, pages, or folders. Selection doesn't grant access.
Indexer Reads one data source and names one target index in targetIndexName. Multiple selected sites don't create multiple target indexes automatically.
Search index Defines the fields and stores searchable content, metadata, and any permission fields used for retrieval.
Search index knowledge source and knowledge base Optionally expose the populated index for agentic retrieval. These retrieval resources don't replace the indexing configuration or the user's document permissions.

For example:

Scenario Resource arrangement
One site with multiple libraries or folders Select the required libraries or folders in one data source and use one indexer when the content shares a target schema and processing requirements.
Selected sites B and C with default endpoint A Use the cross-site query configuration, grant access to B and C, and write through one indexer to one target index. Preserve originating-site context when permission filtering requires it.
Content requiring separate schemas, processing schedules, or governance Use separate indexing pipelines and indexes. For agentic retrieval, expose each index through a search index knowledge source and assign the sources to a knowledge base within its limits.

An indexer's single targetIndexName is distinct from index projections, which can send enriched child documents to other indexes. Every searchable chunk must retain the required permission fields and originating-site context. Follow the ACL mapping and projection guidance.

Adding indexers that write to the same index doesn't increase the SharePoint group site-URL limit. Use the existing partitioning guidance for that permission flow.

If you prefer service-managed ingestion, create an indexed SharePoint knowledge source instead of configuring these indexing resources individually. For architecture and ownership choices, see SharePoint architecture choices.

Configure the SharePoint in Microsoft 365 indexer

Use the 2026-10-01 REST API to configure the SharePoint in Microsoft 365 indexer.

(Optional) Step 1: Enable a system-assigned managed identity

Enable a system-assigned managed identity to automatically detect the Microsoft Entra tenant in which the Foundry IQ service is provisioned.

Perform this step if the SharePoint site and Foundry IQ service are in the same Microsoft Entra tenant. Skip this step if they're in different Microsoft Entra tenants. The identity is used for tenant detection. You can also skip this step if you want to put the Microsoft Entra tenant ID in the connection string. To use system-assigned or user-assigned managed identity for secretless indexing, configure the application permissions with secretless authentication.

Screenshot showing how to enable system assigned managed identity.

After selecting Save, you receive an object ID assigned to your Foundry IQ service.

Step 2: Decide which permissions the indexer requires

For the decision matrix that covers ACL and non-ACL scenarios, see Choose your permissions setup. If you choose delegated permissions, user-delegated tokens expire every 75 minutes and require manual indexing by using Run Indexer when they expire. Delegated permissions are recommended only for small testing operations.

Step 3: Create a Microsoft Entra application registration

The SharePoint in Microsoft 365 indexer uses a Microsoft Entra application for authentication. Create the application registration before you configure its permissions and credentials.

  1. Sign in to the Azure portal.

  2. Search for or navigate to Microsoft Entra ID.

  3. On the Overview page, select + Add > App registration.

    1. Enter a name for your app.
    2. Select Single tenant only - tenant name.
    3. Skip the URI designation step. No redirect URI is required.
    4. Select Register.
  4. From the left pane, select Manage > API permissions.

  5. Select + Add a permission, and then select Microsoft Graph.

    • If your indexer uses application API permissions, select Application permissions.

      • For standard indexing, select:

        • Files.Read.All
        • Sites.Read.All

        Screenshot of application API permissions.

      • If you're enabling ACL ingestion, the required permissions depend on which item types (document library files, list items, ASPX pages) and group types (Microsoft Entra vs. SharePoint site groups) you index. Before you complete this step, see Permissions by ACL scenario. For the cross-scenario summary, see Choose your permissions setup.

        Using application permissions means the indexer accesses the SharePoint site in a service context. Therefore, when you run the indexer, it has access to all content in the SharePoint tenant, which requires tenant admin approval. A client secret or secretless configuration is also required for authentication. Setting up the authentication mechanism is described later in this article under Available authentication methods for application API permissions only.

    • If your indexer uses delegated API permissions, select Delegated permissions, and then select:

      • Files.Read.All
      • Sites.Read.All
      • User.Read

      Screenshot showing delegated API permissions.

      Delegated permissions allow the search client to connect to SharePoint under the security identity of the current user.

  6. Select Grant admin consent for tenant name.

    Tenant admin consent is required when using application API permissions. Some tenants are locked down in such a way that tenant admin consent is also required for delegated API permissions. If either condition applies, a tenant administrator must grant consent for this Microsoft Entra application before creating the indexer.

    Screenshot showing Microsoft Entra app grant admin consent.

  7. From the left pane, select Manage > Authentication (Preview).

  8. On the Redirect URI configuration tab, select + Add Redirect URI.

    1. Select Mobile and desktop applications.
    2. Select the https://login.microsoftonline.com/common/oauth2/nativeclient redirect URI.
    3. Select Configure.
  9. On the Settings tab, enable the Allow public client flows toggle, and then select Save.

  10. Configure the indexer authentication method according to your solution needs.

Grant site access when using Sites.Selected

If you configure the app registration with Sites.Selected, complete the following steps before running the indexer. Admin consent for Sites.Selected in Microsoft Entra ID only allows the app to use scoped SharePoint permissions. It doesn't grant access to any site until you assign a site permission separately.

  1. In Microsoft Entra ID: Add Sites.Selected to the app registration and grant admin consent. Add the permission under the API surface that your scenario requires, such as Microsoft Graph and, for ACL ingestion scenarios, SharePoint.

  2. In SharePoint: Assign the app a permission role on each target site. For indexing content, grant at least read access.

    To grant the site permission, use Microsoft Graph. Replace {siteId} with your site ID:

    POST https://graph.microsoft.com/v1.0/sites/{siteId}/permissions
    Content-Type: application/json
    
    {
      "roles": ["read"],
      "grantedToIdentities": [
        {
          "application": {
            "id": "<application-client-id>",
            "displayName": "<application-display-name>"
          }
        }
      ]
    }
    

    To grant the same permission by using PnP PowerShell:

    Grant-PnPEntraIDAppSitePermission `
      -AppId "<application-client-id>" `
      -DisplayName "<application-display-name>" `
      -Site "https://<tenant>.sharepoint.com/sites/<site-name>" `
      -Permissions Read
    

Available authentication methods for application API permissions only

To authenticate the Microsoft Entra application with application permissions, the indexer uses either a client secret or a secretless configuration.

Using client secret

These instructions configure the application to use a client secret to authenticate the indexer, so it can ingest data from SharePoint.

  1. Select Certificates & Secrets from the menu on the left, and then select Client secrets and New client secret.

    Screenshot showing new client secret.

  2. In the menu that pops up, enter a description for the new client secret. Adjust the expiration date if necessary. If the secret expires, you need to recreate it and update the indexer with the new secret.

    Screenshot showing how to set up a client secret.

  3. The new client secret appears in the secret list. Once you navigate away from the page, the secret isn't visible, so copy the value by using the copy button and save it in a secure location.

    Screenshot showing where to copy a client secret.

Using secretless authentication to obtain application tokens

Use federated credentials to sign in without a client secret. Microsoft Entra trusts a managed identity to obtain an application token, so the indexer can ingest data from SharePoint without a stored secret. The next section walks through configuring a managed identity.

Configuring the registered application with a managed identity

  1. Create (or select) a user-assigned managed identity and assign to your Foundry IQ service or a system-assigned managed identity, depending on your scenario requirements.

  2. Capture the object (principal) ID. Use this value as part of the credentials configuration when you create the data source.

  3. Select Certificates & Secrets from the menu on the left.

  4. Under Federated credentials select + Add a credential.

  5. Under Federated credential scenario select Managed Identity.

  6. Select managed identity: Choose the managed identity created in step 1.

  7. Add a name for your credential and select Save.

Step 4: Create data source

Use a REST client with API version 2026-10-01 for the remaining steps.

A data source specifies which data to index, credentials, and policies to efficiently identify changes in the data (new, modified, or deleted rows). Multiple indexers in the same Foundry IQ service can use the same data source.

For SharePoint indexing, the data source must have the following required properties:

  • name is the unique name of the data source within your Foundry IQ service.
  • type must be "sharepoint". This value is case-sensitive.
  • credentials provide the SharePoint endpoint and the authentication method allowed for the application to request the Microsoft Entra tokens. An example SharePoint endpoint is https://[your-tenant-name].sharepoint.com/teams/MySharePointSite. You can get the endpoint by navigating to the home page of your SharePoint site and copying the URL from the browser. Review the connection string format for the supported syntax.
  • container selects the document libraries, lists, or site pages to index. Its properties control which documents are indexed.

To create a data source, call Create Data Source.

Here's a data source definition sample for credentials with application secret or system-assigned managed identity.

POST https://[service name].search.windows.net/datasources?api-version=2026-10-01
Content-Type: application/json
api-key: [admin key]

{
    "name" : "sharepoint-datasource",
    "type" : "sharepoint",
    "credentials" : { "connectionString" : "[connection-string]" },
    "container" : { "name" : "defaultSiteLibrary", "query" : null }
}

Federated credential configurations require FederatedCredentialApplicationId in the connection string. The value differs by identity type:

  • System-assigned managed identity: Set FederatedCredentialApplicationId to the service's system-assigned managed identity application (client) ID. Omit the identity block.
  • User-assigned managed identity: Supply the identity block with the user-assigned managed identity resource path. Set FederatedCredentialApplicationId to the user-assigned managed identity's own application (client) ID.

Note

ApplicationId and FederatedCredentialApplicationId are different values. ApplicationId is your registered Entra ingestion app that holds the SharePoint permissions. FederatedCredentialApplicationId is the application (client) ID of the managed identity itself, which is the entity whose token proves the managed identity's identity.

POST https://[service name].search.windows.net/datasources?api-version=2026-10-01
Content-Type: application/json
api-key: [admin key]

{
    "name" : "sharepoint-datasource",
    "type" : "sharepoint",
    "credentials" : { "connectionString" : "[connection-string]" },
    "container" : { "name" : "defaultSiteLibrary", "query" : null },
    "identity": {
      "@odata.type": "#Microsoft.Azure.Search.DataUserAssignedIdentity",
      "userAssignedIdentity": "/subscriptions/[Azure subscription ID]/resourceGroups/[resource-group]/providers/Microsoft.ManagedIdentity/userAssignedIdentities/[user-assigned managed identity]"
    }
}

Connection string format

The format of the connection string changes based on whether the indexer is using delegated API permissions or application API permissions.

  • Delegated API permissions connection string format

    SharePointOnlineEndpoint=[SharePoint site URL];ApplicationId=[Microsoft Entra application ID];TenantId=[SharePoint site's Microsoft Entra tenant ID]

  • Application API permissions with application secret connection string format

    SharePointOnlineEndpoint=[SharePoint site URL];ApplicationId=[Microsoft Entra application ID];ApplicationSecret=[Microsoft Entra application client secret];TenantId=[SharePoint site's Microsoft Entra tenant ID]

  • Application API permissions with secretless (federated identity credential) connection string format:

    SharePointOnlineEndpoint=[SharePoint site URL];ApplicationId=[Microsoft Entra application ID];FederatedCredentialApplicationId=[managed identity's application (client) ID];TenantId=[SharePoint site's Microsoft Entra tenant ID]

The following table describes each connection string field.

Field Required Description
SharePointOnlineEndpoint Yes Default SharePoint site URL (for example, https://[your-tenant-name].sharepoint.com). A useQuery container can select other sites in the same tenant. See Select content from other sites.
ApplicationId Yes Microsoft Entra application (client) ID of the ingestion app. Must be a valid GUID.
TenantId Optional Microsoft Entra tenant ID (GUID) for the tenant that owns the SharePoint site. This tenant isn't necessarily the Microsoft Entra tenant associated with the Foundry IQ service. Required when the SharePoint site and Foundry IQ service are in different Microsoft Entra tenants.
ApplicationSecret Conditional Client secret of the ingestion app. Use for secret-based authentication.
FederatedCredentialApplicationId Conditional (federated identity credential) Microsoft Entra application (client) ID used to validate the managed identity. Must be a valid GUID. For a system-assigned managed identity, use the identity's application (client) ID. For a user-assigned managed identity, use the identity's own application (client) ID. For a cross-tenant user-assigned managed identity with federatedIdentityClientId set in the identity block, use the multi-tenant app's client ID.

Important

FederatedCredentialApplicationId and ApplicationSecret are mutually exclusive. Connection strings that combine them are rejected on data source create or update.

When setting up permissions, consider the following information:

For backward compatibility, the SharePoint indexer still accepts FederatedCredentialObjectId (the object/principal ID of the federated identity credential on the ingestion app) in the connection string, so existing data sources keep working without changes. Use FederatedCredentialApplicationId for new and updated data sources.

To get TenantId, open the Microsoft Entra admin center for the tenant that owns the SharePoint site, and copy the Tenant ID from Overview.

You can get the managed identity object (principal) ID from the Configuring the registered application with a managed identity section.

When setting up permissions, consider the following information:

If the SharePoint site and Foundry IQ service are in the same Microsoft Entra tenant and system-assigned managed identity is enabled, you don't have to include TenantId in the connection string. If they're in different Microsoft Entra tenants, you must include TenantId.

The following examples show data sources created with FederatedCredentialApplicationId:

System-assigned managed identity with federated credential:

POST https://[service name].search.windows.net/datasources?api-version=2026-10-01
Content-Type: application/json
api-key: [admin key]

{
  "name": "sharepoint-ds",
  "type": "sharepoint",
  "credentials": {
    "connectionString": "SharePointOnlineEndpoint=https://[your-tenant-name].sharepoint.com;ApplicationId=[Microsoft Entra application ID];TenantId=[SharePoint site's Microsoft Entra tenant ID];FederatedCredentialApplicationId=[system-assigned managed identity's application (client) ID]"
  },
  "container": { "name": "defaultSiteLibrary" }
}

User-assigned managed identity with federated credential (single-tenant):

{
  "name": "sharepoint-uami-fed",
  "type": "sharepoint",
  "credentials": {
    "connectionString": "SharePointOnlineEndpoint=https://[your-tenant-name].sharepoint.com;ApplicationId=[Microsoft Entra application ID];TenantId=[SharePoint site's Microsoft Entra tenant ID];FederatedCredentialApplicationId=[user-assigned managed identity application (client) ID]"
  },
  "container": { "name": "defaultSiteLibrary" },
  "identity": {
    "@odata.type": "#Microsoft.Azure.Search.DataUserAssignedIdentity",
    "userAssignedIdentity": "/subscriptions/[subscription-id]/resourceGroups/[resource-group]/providers/Microsoft.ManagedIdentity/userAssignedIdentities/[uami-name]"
  }
}

Note

For a user-assigned managed identity, FederatedCredentialApplicationId must equal the user-assigned managed identity's application (client) ID, not the ingestion app's ID (ApplicationId). If you omit the identity block, the indexer falls back to the system-assigned managed identity.

Cross-tenant user-assigned managed identity with federated credential (advanced):

Before using this configuration, ensure your user-assigned managed identity is configured with a federated identity credential that trusts the multitenant Microsoft Entra app. For setup steps, see Configuring the registered application with a managed identity.

{
  "name": "sharepoint-uami-crosstenantfed",
  "type": "sharepoint",
  "credentials": {
    "connectionString": "SharePointOnlineEndpoint=https://[your-tenant-name].sharepoint.com;ApplicationId=[Microsoft Entra application ID];TenantId=[SharePoint site's Microsoft Entra tenant ID];FederatedCredentialApplicationId=[multitenant app client ID]"
  },
  "container": { "name": "defaultSiteLibrary" },
  "identity": {
    "@odata.type": "#Microsoft.Azure.Search.DataUserAssignedIdentity",
    "userAssignedIdentity": "/subscriptions/[subscription-id]/resourceGroups/[resource-group]/providers/Microsoft.ManagedIdentity/userAssignedIdentities/[uami-name]",
    "federatedIdentityClientId": "[multi-tenant app client ID]"
  }
}

Use the cross-tenant user-assigned managed identity configuration when the user-assigned managed identity itself federates to a multitenant Microsoft Entra app. In this case, set federatedIdentityClientId in the identity block to the multitenant app's client ID, and set FederatedCredentialApplicationId in the connection string to the same multitenant app's client ID. Setting FederatedCredentialApplicationId to the user-assigned managed identity's own client ID in this scenario fails validation.

If your indexer uses SharePoint ACL configuration or preserves and honors Microsoft Purview sensitivity labels (preview), review the related articles before you create the indexer. Each feature has specific data source, index, and skillset configuration steps.

Step 5: Create an index

The index specifies the fields in a document, attributes, and other constructs that shape the search experience.

To create an index, call Create Index:

POST https://[service name].search.windows.net/indexes?api-version=2026-10-01
Content-Type: application/json
api-key: [admin key]

{
    "name" : "sharepoint-index",
    "fields": [
        { "name": "id", "type": "Edm.String", "key": true, "searchable": false },
        { "name": "metadata_spo_item_name", "type": "Edm.String", "key": false, "searchable": true, "filterable": false, "sortable": false, "facetable": false },
        { "name": "metadata_spo_item_path", "type": "Edm.String", "key": false, "searchable": false, "filterable": false, "sortable": false, "facetable": false },
        { "name": "metadata_spo_item_content_type", "type": "Edm.String", "key": false, "searchable": false, "filterable": true, "sortable": false, "facetable": true },
        { "name": "metadata_spo_item_last_modified", "type": "Edm.DateTimeOffset", "key": false, "searchable": false, "filterable": false, "sortable": true, "facetable": false },
        { "name": "metadata_spo_item_size", "type": "Edm.Int64", "key": false, "searchable": false, "filterable": false, "sortable": false, "facetable": false },
        { "name": "content", "type": "Edm.String", "searchable": true, "filterable": false, "sortable": false, "facetable": false }
    ]
}

Important

The key field in an index populated by the SharePoint in Microsoft 365 indexer depends on the container type in the data source:

  • For document-library content (defaultSiteLibrary, allSiteLibraries, or useQuery with library or folder filters), use metadata_spo_site_library_item_id. If a key field doesn't exist in the data source, metadata_spo_site_library_item_id is automatically mapped to the key field.
  • For list, page, or mixed content (allSiteLists, allSitePages, or allSiteContent), use metadata_spo_site_asset_item_id. Auto-mapping doesn't apply to this field. Define an explicit fieldMappings entry that maps metadata_spo_site_asset_item_id to your index key field.

Apply the base64Encode mapping function when mapping these key fields to your index id field.

Step 6: Create an indexer

An indexer connects a data source with a target search index and provides a schedule to automate the data refresh. After you create the data source and index, create the indexer.

To create the indexer:

  1. Send a Create Indexer request:

    POST https://[service name].search.windows.net/indexers?api-version=2026-10-01
    Content-Type: application/json
    api-key: [admin key]
    
    {
        "name" : "sharepoint-indexer",
        "dataSourceName" : "sharepoint-datasource",
        "targetIndexName" : "sharepoint-index",
        "parameters": {
        "batchSize": null,
        "maxFailedItems": null,
        "maxFailedItemsPerBatch": null,
        "configuration": {
            "indexedFileNameExtensions" : ".pdf, .docx",
            "excludedFileNameExtensions" : ".png, .jpg",
            "dataToExtract": "contentAndMetadata"
          }
        },
        "fieldMappings" : [
            { 
              "sourceFieldName" : "metadata_spo_site_library_item_id", 
              "targetFieldName" : "id", 
              "mappingFunction" : { 
                "name" : "base64Encode" 
              } 
             }
        ]
    }
    

    For data sources that use the allSiteLists, allSitePages, or allSiteContent container values, map metadata_spo_site_asset_item_id instead of metadata_spo_site_library_item_id.

    The document-library example includes only .pdf and .docx files. Adjust the file-type filters to match the content you intend to index.

    When you use application permissions, you can query the index while the initial indexer run is in progress, but only items that are already indexed return results. Wait until the run completes for full coverage. The remaining instructions in this step apply only to delegated permissions.

  2. When you create the indexer for the first time, the Create Indexer request waits until you complete the next step. You must call Get Indexer Status to get the link and enter your new device code.

    GET https://[service name].search.windows.net/indexers/sharepoint-indexer/status?api-version=2026-10-01
    Content-Type: application/json
    api-key: [admin key]
    

    If you don't call Get Indexer Status within 10 minutes, the code expires and you must recreate the data source.

  3. Copy the device sign-in code from the Get Indexer Status response. The device sign-in code can be found in the "errorMessage".

    {
        "lastResult": {
            "status": "transientFailure",
            "errorMessage": "To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <CODE> to authenticate."
        }
    }
    
  4. Enter the code that was included in the error message.

    Screenshot showing how to enter a device code.

  5. The SharePoint in Microsoft 365 indexer accesses the SharePoint content as the signed-in user. The user that signs in during this step is that signed-in user. So, if you sign in with a user account that doesn't have access to a document in the Document Library that you want to index, the indexer doesn't have access to that document.

    If possible, create a new organizational user account and grant it the exact permissions that you want the indexer to have.

  6. Approve the permissions that are being requested.

    Screenshot showing how to approve API permissions.

  7. The Create Indexer initial request completes if all the permissions provided earlier are correct and within the 10-minute timeframe.

When setting up permissions, consider the following information:

If the Microsoft Entra application requires admin approval and wasn't approved before signing in, you might see the following screen. Admin approval is required to continue.

Screenshot showing admin approval required.

Step 7: Check the indexer status

After creating the indexer, call Get Indexer Status:

GET https://[service name].search.windows.net/indexers/sharepoint-indexer/status?api-version=2026-10-01
Content-Type: application/json
api-key: [admin key]

Inspect lastResult for the latest run's status, endTime, itemsProcessed, and itemsFailed. Review its errors and warnings, even if the run reports success. The top-level indexer status running means the indexer is available to run, not that a run is currently in progress. See Monitor indexer execution.

After the run completes, use the following query to inspect an index without document-level permission filtering:

GET https://[service-name].search.windows.net/indexes/[index-name]/docs?search=*&$count=true&api-version=2026-10-01
api-key: [admin-api-key]

For a permission-enabled index, follow the permission-ingestion checks instead. Use an authorized elevated-read query to inspect protected content. An admin key alone doesn't return ACL-protected content.

Check a known source item's content and metadata, not just the document count. For list items and modern pages, compare the result with the expected content representation. If you configured SharePoint group resolution, also verify the originating-site field on documents and projected chunks.

Test permitted and denied users separately with permission-filtered queries, without the elevated-read header. Reserve elevated read for authorized administrative investigations, not as a fallback for end-user queries.

Update the data source

The indexer example doesn't configure a schedule. To process later source changes, configure an indexer schedule or run the indexer manually. Delegated authentication still requires the sign-in steps in the following section when its token expires.

If you change the data source while the device code is expired, sign in again to run the indexer. For example, if you change the data source query, sign in again by using the https://microsoft.com/devicelogin and get the new device code.

To update a data source, follow these steps assuming an expired device code:

  1. Call Run Indexer to manually start indexer execution.

    POST https://[service name].search.windows.net/indexers/sharepoint-indexer/run?api-version=2026-10-01
    Content-Type: application/json
    api-key: [admin key]
    
  2. Check the indexer status.

    GET https://[service name].search.windows.net/indexers/sharepoint-indexer/status?api-version=2026-10-01
    Content-Type: application/json
    api-key: [admin key]
    
  3. If you get an error asking you to visit https://microsoft.com/devicelogin, open the page and copy the new code.

  4. Paste the code into the dialog box.

  5. Manually run the indexer again and check the indexer status. This time, the indexer run should successfully start.

Understand indexed content

The content field contains different representations for files, list items, and modern pages.

SharePoint asset Representation in content
Document library file Text extracted from the file by using the configured document extraction path.
List item JSON-formatted field values. You can also access individual columns for field mapping.
Modern ASPX site page Serialized page fields, which can include HTML markup and JSON escape sequences. This representation isn't guaranteed to be plain text that matches the rendered page.

For lists and pages, serialized content can include field names and other values beyond the visible text. Before configuring chunking or embeddings, inspect the content input passed to your skillset.

An indexed SharePoint knowledge source generates an indexer that uses text parsing for list and page-only selections. It uses default parsing for document libraries or mixed selections such as allSiteContent. The indexer parsing mode is separate from downstream skillset processing.

For managed multilingual ingestion, an indexed SharePoint knowledge source supports automatic per-language analyzers (preview). For an index you configure directly, assign language analyzers to its searchable string fields. These configuration paths are separate.

Index document metadata

If you index document metadata ("dataToExtract": "contentAndMetadata"), you can use the following metadata for indexing.

Identifier Type Description
metadata_spo_site_library_item_id Edm.String The combination key of site ID, library ID, and item ID, which uniquely identifies an item in a document library for a site. Use this field as the index key for the defaultSiteLibrary, allSiteLibraries, and useQuery (library or folder filters) container values.
metadata_spo_site_asset_item_id Edm.String The combination key that uniquely identifies a list item, ASPX site page, or any asset in mixed-content mode. Use this field as the index key for the allSiteLists, allSitePages, and allSiteContent container values.
metadata_spo_site_id Edm.String The ID of the SharePoint site.
metadata_spo_library_id Edm.String The ID of document library.
metadata_spo_item_id Edm.String The ID of the (document) item in the library.
metadata_spo_item_last_modified Edm.DateTimeOffset The last modified date/time (UTC) of the item.
metadata_spo_item_name Edm.String The name of the item.
metadata_spo_item_size Edm.Int64 The size (in bytes) of the item.
metadata_spo_item_content_type Edm.String The content type of the item.
metadata_spo_item_extension Edm.String The extension of the item.
metadata_spo_item_weburi Edm.String The URI of the item.
metadata_spo_item_path Edm.String The combination of the parent path and item name.
metadata_spo_site_url Edm.String The URL of the SharePoint site. Required when you enable SharePoint site group resolution. See Configure SharePoint groups support.

The SharePoint in Microsoft 365 indexer also supports metadata specific to each document type. For more information, see Content metadata properties used in Foundry IQ.

To expose custom document-library metadata in a directly configured indexer, specify additionalColumns in the data source query. Then, use field mappings to map the exposed source fields to compatible index fields. Selecting columns and mapping them are separate steps: a mapping doesn't retrieve a column that the data source hasn't exposed.

Keep the key mapping and any required permission and originating-site mappings when adding custom fields. For SharePoint list columns, follow Map list columns to index fields.

Index SharePoint lists

Set the data source container.name to allSiteLists to index all SharePoint list items from a site. Use allSiteContent to combine list items with document libraries and site pages in a single indexer. To include subsite lists, add includeSubsites=true to the container.query.

For list-based or mixed-content indexers, the index key field must map from metadata_spo_site_asset_item_id. The list item content appears in the content field as JSON-formatted field values, and the standard metadata_spo_item_* fields (such as metadata_spo_item_name, metadata_spo_item_weburi, and metadata_spo_item_last_modified) are populated for each list item.

Map list columns to index fields

Each column you define on a SharePoint list appears as a source field with the same name as the SharePoint column. Use field mappings to map each column to an index field.

For example, consider a SharePoint list with the following columns.

SharePoint column SharePoint column type
Title Single line of text
Price Number
InStock Yes/No
Category Choice

Add matching fields to your index definition, and then map each column to its target field in the indexer:

{
  "name": "my-sharepoint-list-indexer",
  "dataSourceName": "my-sharepoint-list-ds",
  "targetIndexName": "products-index",
  "fieldMappings": [
    {
      "sourceFieldName": "metadata_spo_site_asset_item_id",
      "targetFieldName": "id",
      "mappingFunction": { "name": "base64Encode" }
    },
    { "sourceFieldName": "Title", "targetFieldName": "productName" },
    { "sourceFieldName": "Price", "targetFieldName": "price" },
    { "sourceFieldName": "InStock", "targetFieldName": "available" },
    { "sourceFieldName": "Category", "targetFieldName": "category" },
    { "sourceFieldName": "metadata_spo_item_last_modified", "targetFieldName": "lastUpdated" },
    { "sourceFieldName": "metadata_spo_item_weburi", "targetFieldName": "itemUrl" }
  ]
}

Make sure each target field exists in your index with a compatible type (for example, Edm.String for Title, Edm.Double or Edm.Int64 for Price, Edm.Boolean for InStock).

Index ASPX site pages

Set the data source container.name to allSitePages to index all modern ASPX site pages from a site. Use allSiteContent to combine pages with document libraries and lists in a single indexer. To include subsite pages, add includeSubsites=true to the container.query.

For page-based or mixed-content indexers, the index key field must map from metadata_spo_site_asset_item_id. The content field receives serialized page fields, which can include HTML markup and JSON escape sequences, rather than guaranteed browser-rendered plain text. The standard metadata_spo_item_* fields (such as metadata_spo_item_name, metadata_spo_item_weburi, and metadata_spo_item_last_modified) are populated for each page.

Include or exclude by file type

Set inclusion and exclusion criteria in the "parameters" section of the indexer definition to control which files are indexed.

To include specific file extensions, set "indexedFileNameExtensions" to a comma-separated list of file extensions with a leading dot. To exclude specific file extensions, set "excludedFileNameExtensions" to the extensions that you want to skip. If the same extension appears in both lists, the indexer excludes it from indexing.

PUT /indexers/[indexer name]?api-version=2026-10-01
{
    "parameters" : { 
        "configuration" : { 
            "indexedFileNameExtensions" : ".pdf, .docx",
            "excludedFileNameExtensions" : ".png, .jpeg" 
        } 
    }
}

Control which documents are indexed

A single SharePoint in Microsoft 365 indexer can index content from one or more document libraries. To specify which sites and document libraries to index, use the "container" parameter in the data source definition.

The data source "container" section has two properties for this task: "name" and "query".

Name

The name property is required and must be one of the following values:

Value Description
defaultSiteLibrary Index all content from the site's default document library.
allSiteLibraries Index all content from all document libraries in a site. Document libraries from a subsite are out of scope unless you set includeSubsites=true in the query. You can also choose useQuery and specify includeLibrariesInSite to scope to specific sites or subsites.
allSiteLists Index all SharePoint list items from a site.
allSitePages Index all modern ASPX site pages from a site.
allSiteContent Index libraries, lists, and pages from a site in a single indexer.
useQuery Only index the content defined in the query.

For data sources that use allSiteLists, allSitePages, or allSiteContent, the indexer key field mapping must use metadata_spo_site_asset_item_id instead of metadata_spo_site_library_item_id. For details, see Step 6: Create an indexer.

Query

The "query" parameter of the data source consists of keyword/value pairs. Use the following keywords. The values are either site URLs or document library URLs.

When setting up permissions, consider the following information:

To get the value for a particular keyword, go to the document library you want to include or exclude and copy the URI from the browser. This method is the easiest way to get the value to use with a keyword in the query.

Keyword Value description and examples
null If null or empty, index either the default document library or all document libraries depending on the container name.

Example:

"container" : { "name" : "defaultSiteLibrary", "query" : null }
includeSubsites When set to true, the indexer traverses the root site and subsites within the applicable traversal limits. Combine with allSiteLibraries, allSiteLists, allSitePages, or allSiteContent.

Example:

"container" : { "name" : "allSiteLibraries", "query" : "includeSubsites=true" }
includeLibrariesInSite Index content from all libraries under the site or subsite specified by this keyword's value. This site can differ from SharePointOnlineEndpoint in the connection string. Repeat the keyword to select multiple sites. See Select content from other sites.

Example 1:

"container" : { "name" : "useQuery", "query" : "includeLibrariesInSite=https://mycompany.sharepoint.com/mysite" }

Example 2 (include a few subsites only):

"container" : { "name" : "useQuery", "query" : "includeLibrariesInSite=https://mycompany.sharepoint.com/sites/TopSite/SubSite1;includeLibrariesInSite=https://mycompany.sharepoint.com/sites/TopSite/SubSite2" }
includeLibrary Index all content from this library. The value is the fully qualified path to the library, which you can copy from your browser:

Example 1 (fully qualified path):

"container" : { "name" : "useQuery", "query" : "includeLibrary=https://mycompany.sharepoint.com/mysite/MyDocumentLibrary" }

Example 2 (URI copied from your browser):

"container" : { "name" : "useQuery", "query" : "includeLibrary=https://mycompany.sharepoint.com/teams/mysite/MyDocumentLibrary/Forms/AllItems.aspx" }
excludeLibrary Don't index content from this library. The value is the fully qualified path to the library, which you can copy from your browser:

Example 1 (fully qualified path):

"container" : { "name" : "useQuery", "query" : "includeLibrariesInSite=https://mysite.sharepoint.com/subsite1; excludeLibrary=https://mysite.sharepoint.com/subsite1/MyDocumentLibrary" }

Example 2 (URI copied from your browser):

"container" : { "name" : "useQuery", "query" : "includeLibrariesInSite=https://mycompany.sharepoint.com/teams/mysite; excludeLibrary=https://mycompany.sharepoint.com/teams/mysite/MyDocumentLibrary/Forms/AllItems.aspx" }
includeFolder Index content from a specific folder and its subfolders. Value must be a full SharePoint folder URL.

Behavior: Applies recursively to all subfolders. Multiple folders can be specified by repeating the parameter with semicolons. Folder filters are scoped to a single document library. Root-only paths aren't supported. If a folder referenced is renamed, the query must be updated.

Example 1 (single folder):
"container": { "name": "useQuery", "query": "includeFolder=[your-tenant-name].sharepoint.com/sites/hr/Shared Documents/Policies" }

Example 2 (multiple folders):
"container": { "name": "useQuery", "query": "includeFolder=[your-tenant-name].sharepoint.com/sites/hr/Shared Documents/Specs;includeFolder=[your-tenant-name].sharepoint.com/sites/hr/Shared Documents/Designs" }
excludeFolder Don't index content from a specific folder and its subfolders. Value must be a full SharePoint folder URL.

Behavior: Applies recursively to all subfolders. If a file matches both include and exclude rules, exclude takes precedence and the file is skipped. Folder filters are scoped to a single document library.

Example 1 (exclude folder):
"container": { "name": "useQuery", "query": "excludeFolder=[your-tenant-name].sharepoint.com/sites/hr/Shared Documents/Policies/Archive" }

Example 2 (combine include + exclude):
"container": { "name": "useQuery", "query": "includeFolder=[your-tenant-name].sharepoint.com/sites/hr/Shared Documents/Policies;excludeFolder=[your-tenant-name].sharepoint.com/sites/hr/Shared Documents/Policies/Drafts" }
additionalColumns Index columns from the document library. The value is a comma-separated list of column names you want to index. Use a double backslash to escape semicolons and commas in column names:

Example 1 (additionalColumns=MyCustomColumn,MyCustomColumn2):

"container" : { "name" : "useQuery", "query" : "includeLibrary=https://mycompany.sharepoint.com/mysite/MyDocumentLibrary;additionalColumns=MyCustomColumn,MyCustomColumn2" }

Example 2 (escape characters using double backslash):

"container" : { "name" : "useQuery", "query" : "includeLibrary=https://mycompany.sharepoint.com/teams/mysite/MyDocumentLibrary/Forms/AllItems.aspx;additionalColumns=MyCustomColumnWith\\,,MyCustomColumnWith\\;" }

Select content from other sites

The connection string's SharePointOnlineEndpoint identifies the default site. By setting container.name to useQuery, the query selects which sites or libraries to index. The selected sites can differ from that default site.

The following configuration examples use three sites in the same tenant: Site A, Site B, and Site C. Replace {{sharepoint-site-a-connection-string}} with a connection string whose SharePointOnlineEndpoint is https://contoso.sharepoint.com/sites/site-a. Configure the ingestion application's permissions for every selected site.

This data source selects Site B, even though its connection string identifies Site A:

{
  "name": "sharepoint-site-b",
  "type": "sharepoint",
  "credentials": {
    "connectionString": "{{sharepoint-site-a-connection-string}}"
  },
  "container": {
    "name": "useQuery",
    "query": "includeLibrariesInSite=https://contoso.sharepoint.com/sites/site-b"
  }
}

Reference: Data Sources - Create

To select Sites B and C, repeat includeLibrariesInSite in the query:

{
  "name": "sharepoint-sites-b-c",
  "type": "sharepoint",
  "credentials": {
    "connectionString": "{{sharepoint-site-a-connection-string}}"
  },
  "container": {
    "name": "useQuery",
    "query": "includeLibrariesInSite=https://contoso.sharepoint.com/sites/site-b;includeLibrariesInSite=https://contoso.sharepoint.com/sites/site-c"
  }
}

Reference: Data Sources - Create

Query selection doesn't grant access. When you use Sites.Selected, grant the app access to each selected site. See Grant site access when using Sites.Selected.

Data source creation and runtime access are separate checks. If setup validation probes the connection-string endpoint, successful access to Site A doesn't verify access to Sites B or C. Check the indexer's status and execution history to verify processing of the selected sites.

For permission-aware indexing, follow the SharePoint permission configuration to map metadata_spo_site_url and preserve the originating-site context in the index and any projected documents. The sharepointSiteUrl: true field property identifies the site-context field used for SharePoint group resolution; it isn't a site-selection rule or an allow list. The per-index site limit still applies.

Handle errors

Identify the failing connection

A successful request to Foundry IQ doesn't prove that the indexer can read SharePoint. Successful ingestion also doesn't prove that an end user can retrieve a protected item. Identify the failing stage before changing permissions or network settings.

Connection Identity or credential to check Diagnostic action
Client or application to Foundry IQ The caller's Microsoft Entra identity or configured API key. Check the search endpoint, applicable data-plane roles, and search-service network access. Caller authentication is separate from the user's document permissions.
Indexer to Microsoft Graph and SharePoint The configured SharePoint ingestion app and, if used, delegated sign-in. Review indexer status and execution history. Check the tenant, credentials, admin consent, and site grants for each selected site. The connection-string endpoint alone doesn't establish access to every query-selected site.
Query-time permission resolution to Microsoft Graph and SharePoint The end user's permission context and the configured SharePoint group-resolution app. Follow SharePoint permission-filtering diagnostics. Check the query token, indexed permission/site metadata, and group-resolution configuration rather than broadening the ingestion app's access.
Enrichment to model or Foundry endpoints The search managed identity for keyless calls, or the configured resource key. Inspect the failing skill and its resource endpoint, authorization, input limits, and network configuration.

Check inbound and outbound connections separately. An inbound private endpoint for Search can coexist with public outbound connections to SharePoint Online. Shared private links apply only to supported destinations, not SharePoint Online. The Conditional Access limitation still applies.

For support, capture the failing stage, UTC timestamp, HTTP status, and request or correlation ID. Remove tokens, API keys, secrets, and tenant-specific identifying details from shared diagnostics.

Handle indexing failures

For an Invalid AAD tenant message, a missing Microsoft Entra tenant ID, or a tenant mismatch that appears in indexer execution history, see Troubleshoot common indexer errors and warnings.

The document-skipping settings in the following section don't fix authentication or permission failures.

By default, the SharePoint in Microsoft 365 indexer stops as soon as it encounters a document with an unsupported content type, such as an image. Use the excludedFileNameExtensions parameter to skip certain content types. However, you might need to index documents without knowing all the possible content types in advance. To continue indexing when the indexer encounters an unsupported content type, set the failOnUnsupportedContentType configuration parameter to false:

PUT https://[service name].search.windows.net/indexers/[indexer name]?api-version=2026-10-01
Content-Type: application/json
api-key: [admin key]

{
    ... other parts of indexer definition
    "parameters" : { "configuration" : { "failOnUnsupportedContentType" : false } }
}

For some documents, Foundry IQ is unable to determine the content type or can't process a document of an otherwise supported content type. To ignore this failure mode, set the failOnUnprocessableDocument configuration parameter to false:

"parameters" : { "configuration" : { "failOnUnprocessableDocument" : false } }

SharePoint source files use the shared source-file size and extracted-character limits for blob-like indexers. By default, oversized documents are treated as errors. However, you can still index storage metadata of oversized documents if you set the indexStorageMetadataOnlyForOversizedDocuments configuration parameter to true:

"parameters" : { "configuration" : { "indexStorageMetadataOnlyForOversizedDocuments" : true } }

If you add a skillset, check each skill's input and downstream service limits separately. A skill can accept less data than the SharePoint indexer extracts.

You can also continue indexing if errors happen at any point of processing, either while parsing documents or while adding documents to an index. To ignore a specific number of errors, set the maxFailedItems and maxFailedItemsPerBatch configuration parameters to the desired values. For example:

{
    ... other parts of indexer definition
    "parameters" : { "maxFailedItems" : 10, "maxFailedItemsPerBatch" : 10 }
}

Understand synchronization retries

The process that tracks changes in SharePoint can request a synchronization retry. Foundry IQ can then reprocess previously indexed items to help avoid missing changes and preserve data integrity, even when you haven't edited those items.

This behavior applies with or without ACL ingestion. Depending on your pipeline, reprocessing can rerun enrichment and embedding generation, increasing processing time and costs.

A synchronization retry is separate from a permissions resync, which refreshes indexed permissions without rerunning enrichment or embeddings. Content reprocessing during a later normal run doesn't mean the permissions-only run performed that work.

If retries repeat or processing is unexpected, review the indexer execution history. When contacting Support, provide the affected runs' UTC times, status, errors, and available request IDs. Don't include credentials, user tokens, or document content.