Upload a file to SharePoint

Uploads a file to a SharePoint document library. Supports both simple upload (<4MB) and chunked upload for larger files.

yaml
type: "io.kestra.plugin.microsoft365.sharepoint.Upload"

Upload a file to SharePoint root

yaml
id: microsoft365_sharepoint_upload
namespace: company.team

tasks:
  - id: upload
    type: io.kestra.plugin.microsoft365.sharepoint.Upload
    tenantId: "{{ secret('AZURE_TENANT_ID') }}"
    clientId: "{{ secret('AZURE_CLIENT_ID') }}"
    clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
    siteId: "contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"
    driveId: "b!BCTBCKSP50iysCOFPU"
    from: "{{ outputs.previous_task.uri }}"
    to: "report.pdf"
    parentId: "root"

Upload a file to a specific folder with replace conflict behavior

yaml
id: microsoft365_sharepoint_upload_folder
namespace: company.team

tasks:
  - id: upload
    type: io.kestra.plugin.microsoft365.sharepoint.Upload
    tenantId: "{{ secret('AZURE_TENANT_ID') }}"
    clientId: "{{ secret('AZURE_CLIENT_ID') }}"
    clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
    siteId: "contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"
    driveId: "b!BCTBCKSP50iysCOFPU"
    from: "kestra:///data/output.xlsx"
    to: "monthly-report.xlsx"
    parentId: "01BYE5RZ6QN3ZWBTURF3F43DSUNZYRZD5Q"
    conflictBehavior: REPLACE
Properties

Azure Client ID

The client ID registered in Azure

Azure Client Secret

The client secret for the registered application

Source file URI

The URI of the file to upload from Kestra's internal storage

Sharepoint Site ID

The id of the

Azure Tenant ID

The Azure Active Directory tenant ID

Destination filename

The name of the file in SharePoint

Default 5242880

Chunk size for large files

The size of each chunk in bytes for large file uploads. Default is 5MB.

Default FAIL
Possible Values
FAILREPLACERENAME

Conflict behavior

What to do if a file with the same name already exists

Drive ID

The id of the document library within the SharePoint site. If not provided, the default document library will be used.

Default root

Parent folder ID

The ID of the parent folder where the file will be uploaded. Use 'root' for the root of the document library.

The ID of the uploaded item

The name of the uploaded file

The size of the uploaded file in bytes

The web URL of the uploaded file