Skip to main content

Microsoft SharePoint

Load data from Microsoft SharePoint

Authentication Setup

To connect to SharePoint, you'll need to set up authentication using Microsoft Entra ID (formerly Azure AD):

  1. Create an App Registration in Microsoft Entra ID (Microsoft Documentation)

  2. Configure the following Microsoft Graph API Permissions for your app:

    • Sites.ReadAll (Application Permission) - Required to read items in all site collections
    • Files.ReadAll (Application Permission) - Required to read all files that app has access to
    • BrowserSiteLists.Read.All (Application Permission) - Required to read all SharePoint lists
  3. Grant admin consent for each permission in the Azure Portal

  4. Note down the following values which will be needed for configuration:

    • Client ID (Application ID)
    • Client Secret (generate in Certificates & Secrets)
    • Tenant ID (Directory ID)

For more details on Microsoft Graph APIs and permissions, see the Microsoft Graph documentation.

Configure via UI

sharepoint

Configure via API / Client

from llama_cloud.types import CloudSharepointDataSource

ds = {
'name': '<your-name>',
'source_type': 'MICROSOFT_SHAREPOINT',
'component': CloudSharepointDataSource(
site_name='<site_name>',
folder_path='<folder_path>', # optional
client_id='<client_id>',
client_secret='<client_secret>',
tenant_id='<tenant_id>',
)
}
data_source = client.data_sources.create_data_source(request=ds)