
Microsoft 365 Upload
CertifiedUpload file to SharePoint
Microsoft 365 Upload
Upload file to SharePoint
Uploads a file from Kestra internal storage to a SharePoint document library using Graph simple upload (best for files up to ~4MB; larger files may fail). PUT replaces existing files; conflictBehavior is currently ignored. 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
Properties
clientId *Requiredstring
Azure client ID
Application (client) ID of the registered Entra ID app
clientSecret *Requiredstring
Azure client secret
Client secret for the app registration; required for client-credentials flow
from *Requiredstring
Source file URI
URI of the file in Kestra internal storage to upload
siteId *Requiredstring
SharePoint site ID
Site identifier in Graph format hostname,siteId,webId
tenantId *Requiredstring
Azure tenant ID
Azure AD (Entra ID) tenant GUID used for Graph authentication
to *Requiredstring
Destination filename
Filename to create in SharePoint
chunkSize integerstring
5242880Chunk size for large files
Unused placeholder for chunked uploads; Graph simple upload is used instead
conflictBehavior Non-dynamicstring
FAILFAILREPLACERENAMEConflict behavior
Reserved flag for naming conflicts; currently ignored and the upload overwrites existing files
driveId string
Drive ID
Document library ID; if omitted the first drive returned for the site is used
parentId string
rootParent folder ID
Parent folder ID; use 'root' for the document library root
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
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