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):
-
Create an App Registration in Microsoft Entra ID (Microsoft Documentation)
-
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
-
Grant admin consent for each permission in the Azure Portal
-
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
Configure via API / Client
- Python Client
- TypeScript 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)
const ds = {
'name': 'sharepoint',
'sourceType': 'MICROSOFT_SHAREPOINT',
'component': {
'site_name': 'site_name',
'folder_path': 'folder_path', // optional
'client_id': 'client_id',
'client_secret': 'client_secret',
'tenant_id': 'tenant_id',
}
}
data_source = await client.dataSources.createDataSource({
body: ds
})