Skip to main content
Use the OneDrive Connector to ingest files from Microsoft OneDrive for Business (Microsoft 365) into the mAItion knowledge base.

What It Does

  • discovers files via the Microsoft Graph API by folder ID, folder path, file IDs, file paths, or the whole drive
  • recursively traverses subfolders and follows OneDrive shared/remote items
  • converts downloaded files to Markdown for indexing
  • filters by MIME type and skips files above a configurable size limit
  • runs ingestion on configurable schedules

Authentication

The connector uses App authentication (client credentials) via client_id, client_secret, and tenant_id. Only OneDrive for Business is supported — OneDrive Personal accounts are not supported. The Azure app registration needs the application permission Files.Read.All with admin consent granted. Without it, Graph API calls fail with a 403 error.

Required Environment Variables

Set these in .env.rag:
  • ONEDRIVE1_CLIENT_ID: Azure app registration client ID
  • ONEDRIVE1_CLIENT_SECRET: Azure app registration client secret
  • ONEDRIVE1_TENANT_ID: Azure tenant ID
  • ONEDRIVE1_USER_PRINCIPAL_NAME: user principal name / email of the OneDrive owner (example: user@your-org.onmicrosoft.com)
  • ONEDRIVE1_SCHEDULES: ingestion interval in seconds (default: 3600)

config.yaml Example

.env.rag Example

Configuration Reference

If none of folder_id, folder_path, file_ids, or file_paths are set, all files from the drive root are loaded.

Multiple OneDrive Sources

Add more sources entries (onedrive2, onedrive3, etc) with separate env vars per source.