Upload a file to SharePoint
Uploads a file to a SharePoint document library. Supports both simple upload (<4MB) and chunked upload for larger files.
type: "io.kestra.plugin.microsoft365.sharepoint.Upload"Examples
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
Properties
clientId *Requiredstring
Azure Client ID
The client ID registered in Azure
clientSecret *Requiredstring
Azure Client Secret
The client secret for the registered application
from *Requiredstring
Source file URI
The URI of the file to upload from Kestra's internal storage
siteId *Requiredstring
Sharepoint Site ID
The id of the
tenantId *Requiredstring
Azure Tenant ID
The Azure Active Directory tenant ID
to *Requiredstring
Destination filename
The name of the file in SharePoint
chunkSize integerstring
5242880Chunk size for large files
The size of each chunk in bytes for large file uploads. Default is 5MB.
conflictBehavior Non-dynamicstring
FAILFAILREPLACERENAMEConflict behavior
What to do if a file with the same name already exists
driveId string
Drive ID
The id of the document library within the SharePoint site. If not provided, the default document library will be used.
parentId string
rootParent folder ID
The ID of the parent folder where the file will be uploaded. Use 'root' for the root of the document library.
Outputs
itemId string
The ID of the uploaded item
name string
The name of the uploaded file
size integer
The size of the uploaded file in bytes
webUrl string
The web URL of the uploaded file