Connect a OneDrive data source
After you set up authentication and store your credentials in an AWS Secrets Manager secret, create the OneDrive data source in your knowledge base. This page describes how to create the data source with the AWS Management Console or the API, followed by a reference for the connector parameters you can configure.
Note
Complete authentication setup first. See Set up Microsoft Entra App ID authentication for OneDrive (recommended) or Set up OAuth 2.0 authentication for OneDrive. You need the secret ARN, your tenant ID, and (for document-level access control) the Amazon S3 location of your certificate.
Create the data source
Connector parameters
The data source configuration uses the following connector parameters. To connect to OneDrive, specify ONEDRIVE as the connector type in
connectorParameters. For the
fields that wrap connectorParameters (such as deletionProtectionConfiguration and
mediaExtractionConfiguration), see Connect a data source.
| Field | Required | Description |
|---|---|---|
secretArn |
Yes | The ARN of the AWS Secrets Manager secret containing your OneDrive credentials. |
tenantId |
Yes | The Microsoft Entra (Azure AD) tenant ID. |
authType |
Yes | The authentication type: ENTRA_APP_ID (recommended) or OAUTH2. See Authentication methods. |
certificateS3Path |
Conditional | Required when aclEnabled is true (Microsoft Entra App ID authentication). Contains s3BucketName and s3KeyName for the .p12 certificate file in Amazon S3. Not used for content-only crawling or with OAUTH2. |
| Field | Required | Description |
|---|---|---|
crawlPersonalDrives |
No | Whether to crawl users' personal drives. |
crawlSharedWithMe |
No | Whether to crawl files shared with the signed-in user. Supported only with OAUTH2 authentication. Microsoft Entra App ID (application-only) authentication cannot crawl shared files. |
Note
OneNote notebooks are not currently supported.
| Field | Required | Description |
|---|---|---|
inclusionUserEmailAddresses |
No | User email addresses whose drives to include. |
exclusionUserEmailAddresses |
No | User email addresses whose drives to exclude. |
userFilterPath |
No | An Amazon S3 URL pointing to a file that lists the users to include or exclude. |
inclusionDriveItems |
No | Drive item paths to include. |
exclusionDriveItems |
No | Drive item paths to exclude. |
includeMimeTypes |
No | MIME types to include. |
excludeMimeTypes |
No | MIME types to exclude. |
absoluteDateBefore |
No | Only include content modified before this date (ISO 8601). |
absoluteDateAfter |
No | Only include content modified after this date (ISO 8601). |
Note
With OAUTH2 authentication the connector crawls in the signed-in user's delegated context. The user-based filters (inclusionUserEmailAddresses, exclusionUserEmailAddresses, userFilterPath) determine which users' drives the connector attempts; drives the signed-in user cannot access are silently skipped. To crawl every user's OneDrive in your tenant regardless of permissions, use ENTRA_APP_ID authentication.
| Field | Required | Description |
|---|---|---|
aclEnabled |
No | Set to true to enable document-level access control. Requires ENTRA_APP_ID authentication and a certificateS3Path in connectionConfiguration. You cannot change this setting after you create the data source. For details, see Document-level access controls. |
Change the authentication method
You can change a data source's authentication method (for example, from OAuth 2.0 to Microsoft Entra App ID) by updating the data source with the new authType and credentials, using the UpdateDataSource operation or the AWS Management Console. The document-level access control setting is fixed when you create a data source, so to add or remove ACLs you must create a new data source.
Next steps
After you create the data source, sync it to ingest content into your knowledge base. For details, see Sync a data source. To filter query results by user permissions, see Document-level access controls.