Ingest data from SharePoint
This feature is in Beta. Workspace admins can control access to this feature from the Previews page. See Manage Databricks previews.
The managed SharePoint connector supports use in workspaces with the Configure enhanced security and compliance settings enabled.
This page shows how to create a managed Microsoft SharePoint ingestion pipeline using Lakeflow Connect.
Before you begin
-
To create the ingestion pipeline, you must first meet the following requirements:
-
Your workspace must be enabled for Unity Catalog.
-
Serverless compute must be enabled for your workspace. See Serverless compute requirements.
-
If you plan to create a new connection: You must have
CREATE CONNECTIONprivileges on the metastore. See Manage privileges in Unity Catalog.If the connector supports UI-based pipeline authoring, an admin can create the connection and the pipeline at the same time by completing the steps on this page. However, if the users who create pipelines use API-based pipeline authoring or are non-admin users, an admin must first create the connection in Catalog Explorer. See Connect to managed ingestion sources.
-
If you plan to use an existing connection: You must have
USE CONNECTIONprivileges orALL PRIVILEGESon the connection object. -
You must have
USE CATALOGprivileges on the target catalog. -
You must have
USE SCHEMAandCREATE TABLEprivileges on an existing schema orCREATE SCHEMAprivileges on the target catalog.
-
-
To ingest from SharePoint, you must first configure a supported authentication method. See Set up OAuth U2M: Databricks-managed (Recommended).
Create an ingestion pipeline
For a list of supported file formats and connector-specific limitations, see Microsoft SharePoint connector limitations.
- Databricks UI
- Databricks notebook
- Declarative Automation Bundles
- In the sidebar of the Databricks workspace, click Data Ingestion.
- On the Add data page, in the Databricks connectors section, click Microsoft SharePoint.
- In the Connection step of the ingestion wizard, select the connection that stores your SharePoint access credentials. If you have the
CREATE CONNECTIONprivilege on the metastore, you can clickCreate connection to create a new connection with the authentication details in Overview of SharePoint ingestion setup.
- Click Next.
- In the Ingestion setup step, enter a name for the pipeline.
- Select a catalog and a schema for the pipeline. If you have
USE CATALOGandCREATE SCHEMAprivileges on the catalog, you can clickCreate schema in the drop-down menu to create a new schema.
- Click Create ingestion pipeline and start compute.
- In the Source step, configure the SharePoint URL and file ingestion options.
- Click Save and continue.
- In the Destination step, select a catalog and a schema to load data into. If you have
USE CATALOGandCREATE SCHEMAprivileges on the catalog, you can clickCreate schema in the drop-down menu to create a new schema.
- Click Save and continue.
- (Optional) In the Schedules and notifications step, click
Create schedule. Set the frequency to refresh the destination tables.
- (Optional) Click
Add notification to set email notifications for pipeline operation success or failure, then click Save and run pipeline.
-
Import the following notebook into your Databricks workspace:
-
Do not modify cell one.
-
Modify cell three with your pipeline configuration details. See pipeline.ingestion_definition and Examples.
-
Click Run all.
Use Declarative Automation Bundles to manage SharePoint pipelines as code. Bundles can contain YAML definitions of jobs and tasks, are managed using the Databricks CLI, and can be shared and run in different target workspaces (such as development, staging, and production). For more information, see What are Declarative Automation Bundles?.
-
Create a bundle using the Databricks CLI:
Bashdatabricks bundle init -
Add two new resource files to the bundle:
- A pipeline definition file (for example,
resources/sharepoint_pipeline.yml). See pipeline.ingestion_definition and Examples. - A job definition file that controls the frequency of data ingestion (for example,
resources/sharepoint_job.yml).
- A pipeline definition file (for example,
-
Deploy the pipeline using the Databricks CLI:
Bashdatabricks bundle deploy
Examples
Use these examples to configure your pipeline.
Ingest files as binary (unstructured)
Ingest all files in a SharePoint site as binary content. Use this approach for PDFs, Office documents, and other files you intend to process downstream, for example for RAG applications.
- Declarative Automation Bundles
- Databricks notebook
resources:
pipelines:
sharepoint_binary_pipeline:
name: sharepoint_binary_pipeline
catalog: main
schema: ingest_destination_schema
channel: PREVIEW
ingestion_definition:
connection_name: <sharepoint-connection>
objects:
- table:
destination_catalog: main
destination_schema: ingest_destination_schema
destination_table: site_files
connector_options:
sharepoint_options:
entity_type: FILE
url: https://<tenant>.sharepoint.com/sites/<site>
file_ingestion_options:
format: BINARYFILE
schema_evolution_mode: NONE
pipeline_spec = """
{
"name": "<pipeline-name>",
"catalog": "main",
"schema": "ingest_destination_schema",
"ingestion_definition": {
"connection_name": "<sharepoint-connection>",
"objects": [
{
"table": {
"destination_catalog": "main",
"destination_schema": "ingest_destination_schema",
"destination_table": "site_files",
"connector_options": {
"sharepoint_options": {
"entity_type": "FILE",
"url": "https://<tenant>.sharepoint.com/sites/<site>",
"file_ingestion_options": {
"format": "BINARYFILE",
"schema_evolution_mode": "NONE"
}
}
}
}
}
]
},
"channel": "PREVIEW"
}
"""
create_pipeline(pipeline_spec)
Ingest structured files
Ingest structured files (for example, JSON files) from a SharePoint folder. Each row in the source files becomes a row in the destination table.
- Declarative Automation Bundles
- Databricks notebook
resources:
pipelines:
sharepoint_json_pipeline:
name: sharepoint_json_pipeline
catalog: main
schema: ingest_destination_schema
channel: PREVIEW
ingestion_definition:
connection_name: <sharepoint-connection>
objects:
- table:
destination_catalog: main
destination_schema: ingest_destination_schema
destination_table: json_files
connector_options:
sharepoint_options:
entity_type: FILE
url: https://<tenant>.sharepoint.com/sites/<site>/<json_folder>
file_ingestion_options:
format: JSON
schema_evolution_mode: NONE
pipeline_spec = """
{
"name": "<pipeline-name>",
"catalog": "main",
"schema": "ingest_destination_schema",
"ingestion_definition": {
"connection_name": "<sharepoint-connection>",
"objects": [
{
"table": {
"destination_catalog": "main",
"destination_schema": "ingest_destination_schema",
"destination_table": "json_files",
"connector_options": {
"sharepoint_options": {
"entity_type": "FILE",
"url": "https://<tenant>.sharepoint.com/sites/<site>/<json_folder>",
"file_ingestion_options": {
"format": "JSON",
"schema_evolution_mode": "NONE"
}
}
}
}
}
]
},
"channel": "PREVIEW"
}
"""
create_pipeline(pipeline_spec)
Ingest file metadata only
Ingest file metadata (name, size, timestamps, path) without downloading file contents. Use this approach when you need an inventory of files without the overhead of ingesting their content.
- Declarative Automation Bundles
- Databricks notebook
resources:
pipelines:
sharepoint_metadata_pipeline:
name: sharepoint_metadata_pipeline
catalog: main
schema: ingest_destination_schema
channel: PREVIEW
ingestion_definition:
connection_name: <sharepoint-connection>
objects:
- table:
destination_catalog: main
destination_schema: ingest_destination_schema
destination_table: file_metadata
connector_options:
sharepoint_options:
entity_type: FILE_METADATA
url: https://<tenant>.sharepoint.com/sites/<site>/<library>
file_ingestion_options:
format: BINARYFILE
schema_evolution_mode: NONE
pipeline_spec = """
{
"name": "<pipeline-name>",
"catalog": "main",
"schema": "ingest_destination_schema",
"ingestion_definition": {
"connection_name": "<sharepoint-connection>",
"objects": [
{
"table": {
"destination_catalog": "main",
"destination_schema": "ingest_destination_schema",
"destination_table": "file_metadata",
"connector_options": {
"sharepoint_options": {
"entity_type": "FILE_METADATA",
"url": "https://<tenant>.sharepoint.com/sites/<site>/<library>",
"file_ingestion_options": {
"format": "BINARYFILE",
"schema_evolution_mode": "NONE"
}
}
}
}
}
]
},
"channel": "PREVIEW"
}
"""
create_pipeline(pipeline_spec)
Declarative Automation Bundles job definition file
The following is an example job definition file for use with Declarative Automation Bundles. The job runs every day, exactly one day from the last run.
- Declarative Automation Bundles
resources:
jobs:
sharepoint_job:
name: sharepoint_job
trigger:
periodic:
interval: 1
unit: DAYS
email_notifications:
on_failure:
- <email-address>
tasks:
- task_key: refresh_pipeline
pipeline_task:
pipeline_id: ${resources.pipelines.sharepoint_binary_pipeline.id}
Configure file ingestion options
The file_ingestion_options block controls how files are processed. All options are set inside the sharepoint_options.file_ingestion_options block in the pipeline definition.
File filters
Use file_filters to restrict which files are ingested from the source URL:
"file_ingestion_options": {
"format": "CSV",
"file_filters": [
{ "path_filter": "invoices/*.csv" },
{ "modified_after": "2026-01-01T00:00:00" }
]
}
For full file_ingestion_options parameter reference, see Microsoft SharePoint connector reference.
Schema evolution
Set schema_evolution_mode to control how new columns in incoming files are handled. Modes match Auto Loader schema evolution modes. For details, see Microsoft SharePoint connector reference.
Schema hints
Override inferred column types using schema_hints:
"file_ingestion_options": {
"format": "CSV",
"schema_hints": "order_id INT, amount DOUBLE, ts TIMESTAMP"
}
See Override schema inference with schema hints for usage details.
Format-specific options
Pass format-specific options using format_options:
"file_ingestion_options": {
"format": "CSV",
"format_options": {
"header": "true",
"sep": ","
}
}
Supported keys are the standard Auto Loader format options. See Format options.
Common patterns
For advanced pipeline configurations, see Common patterns for managed ingestion pipelines.
Next steps
- Start, schedule, and set alerts on your pipeline. See Common pipeline maintenance tasks.
- You can parse the raw documents to text, chunk the parsed data, create embeddings from the chunks, and more. You can then use
readStreamon the output table directly in your downstream pipeline. See Downstream RAG use case.