
Microsoft SharePoint Upload
CertifiedUpload file to SharePoint
Microsoft SharePoint Upload
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.
type: io.kestra.plugin.microsoft365.sharepoint.UploadExamples
Upload a file to SharePoint root
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
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
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
clientId *string
Azure client ID
Application (client) ID of the registered Entra ID app
clientSecret *string
Azure client secret
Client secret for the app registration; required for client-credentials flow
from *string
Source file URI
URI of the file in Kestra internal storage to upload
siteId *string
SharePoint site ID
Site identifier in Graph format hostname,siteId,webId
tenantId *string
Azure tenant ID
Azure AD (Entra ID) tenant GUID used for Graph authentication
to *string
Destination filename
Filename to create in SharePoint
assets
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.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset 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.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150chunkSize integerstring
5242880Chunk 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).
conflictBehavior string
FAILFAILREPLACERENAMEConflict 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.
driveId string
Drive ID
Document library ID; if omitted the first drive returned for the site is used
largeFileThreshold integerstring
4194304Large 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.
parentId string
rootParent folder ID
Parent folder ID; use 'root' for the document library root
Outputs
itemId string
ID of the uploaded item
name string
Name of the uploaded file
size integer
Size of the uploaded file in bytes
webUrl string
Web URL of the uploaded file