Microsoft SharePoint Upload

Microsoft SharePoint Upload

Certified

Upload file to SharePoint

Uploads a file from Kestra internal storage to a SharePoint document library. Files up to largeFileThreshold (4MB by default) are uploaded with a single Microsoft Graph PUT (simple upload); above that threshold the file is uploaded through a resumable upload session in chunks of chunkSize bytes. conflictBehavior is honored for resumable uploads but ignored for simple uploads, which always overwrite an existing file. Requires Microsoft Graph permissions Files.ReadWrite.All and Sites.ReadWrite.All.

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

Upload a large file using a resumable upload session with a custom chunk size

yaml
id: microsoft365_sharepoint_upload_large_file
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: "archive.zip"
    parentId: "root"
    conflictBehavior: REPLACE
    chunkSize: 10485760 # 10MB, must be a multiple of 320 KiB
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-microsoft365 --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

Properties

Azure client ID

Application (client) ID of the registered Entra ID app

Azure client secret

Client secret for the app registration; required for client-credentials flow

Source file URI

URI of the file in Kestra internal storage to upload

SharePoint site ID

Site identifier in Graph format hostname,siteId,webId

Azure tenant ID

Azure AD (Entra ID) tenant GUID used for Graph authentication

Destination filename

Filename to create in SharePoint

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Default5242880

Chunk size for large files

Size, in bytes, of each chunk sent when uploading a file larger than largeFileThreshold through a Microsoft Graph resumable upload session; files at or below it use simple upload and are not chunked. Must be a positive multiple of 320 KiB (327,680 bytes) and strictly less than 60 MiB (62,914,560 bytes), as required by the Graph API; an invalid value fails the task whatever the file size. Microsoft recommends a value between 5 and 10 MiB. Defaults to 5MB (5,242,880 bytes).

DefaultFAIL
Possible Values
FAILREPLACERENAME

Conflict behavior

How to handle an existing file at the destination when uploading through a resumable upload session (files larger than largeFileThreshold): FAIL aborts the upload, REPLACE overwrites the existing file, and RENAME creates a new file instead. Ignored for simple uploads (files at or below largeFileThreshold), which always overwrite an existing file.

Drive ID

Document library ID; if omitted the first drive returned for the site is used

Default4194304

Large file threshold

Size, in bytes, above which the file is uploaded through a Microsoft Graph resumable upload session instead of a single PUT. Defaults to 4MB (4,194,304 bytes). Simple upload itself supports files up to 250MB, so raising this trades chunked resumability for fewer round trips.

Defaultroot

Parent folder ID

Parent folder ID; use 'root' for the document library root

ID of the uploaded item

Name of the uploaded file

Size of the uploaded file in bytes

Web URL of the uploaded file