Ingest data from SharePoint

Important

This feature is in Beta. Workspace admins can control access to this feature from the Previews page. See Manage Azure Databricks previews.

:::note Compliance

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 CONNECTION privileges 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 CONNECTION privileges or ALL PRIVILEGES on the connection object.

    • You must have USE CATALOG privileges on the target catalog.

    • You must have USE SCHEMA and CREATE TABLE privileges on an existing schema or CREATE SCHEMA privileges 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

  1. In the sidebar of the Azure Databricks workspace, click Data Ingestion.
  2. On the Add data page, in the Databricks connectors section, click Microsoft SharePoint.
  3. In the Connection step of the ingestion wizard, select the connection that stores your SharePoint access credentials. If you have the CREATE CONNECTION privilege on the metastore, you can click Plus icon. Create connection to create a new connection with the authentication details in Overview of SharePoint ingestion setup.
  4. Click Next.
  5. In the Ingestion setup step, enter a name for the pipeline.
  6. Select a catalog and a schema for the pipeline. If you have USE CATALOG and CREATE SCHEMA privileges on the catalog, you can click Plus icon. Create schema in the drop-down menu to create a new schema.
  7. Click Create ingestion pipeline and start compute.
  8. In the Source step, configure the SharePoint URL and file ingestion options.
  9. Click Save and continue.
  10. In the Destination step, select a catalog and a schema to load data into. If you have USE CATALOG and CREATE SCHEMA privileges on the catalog, you can click Plus icon. Create schema in the drop-down menu to create a new schema.
  11. Click Save and continue.
  12. (Optional) In the Schedules and notifications step, click Plus icon. Create schedule. Set the frequency to refresh the destination tables.
  13. (Optional) Click Plus icon. Add notification to set email notifications for pipeline operation success or failure, then click Save and run pipeline.

Databricks notebook

  1. Import the following notebook into your Azure Databricks workspace:

    Get notebook

  2. Do not modify cell one.

  3. Modify cell three with your pipeline configuration details. See pipeline.ingestion_definition and Examples.

  4. Click Run all.

Declarative Automation Bundles

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?.

  1. Create a bundle using the Databricks CLI:

    databricks bundle init
    
  2. 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).
  3. Deploy the pipeline using the Databricks CLI:

    databricks 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

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

Databricks notebook

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

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

Databricks notebook

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

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

Databricks notebook

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 readStream on the output table directly in your downstream pipeline. See Downstream RAG use case.

Additional resources