Microsoft 365 Upload

Microsoft 365 Upload

Certified

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.

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

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

Default5242880

Chunk size for large files

Unused placeholder for chunked uploads; Graph simple upload is used instead

DefaultFAIL
Possible Values
FAILREPLACERENAME

Conflict behavior

Reserved flag for naming conflicts; currently ignored and the upload overwrites existing files

Drive ID

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

Defaultroot

Parent folder ID

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

Reference (ref) of the pluginDefaults to apply to this task.

ID of the uploaded item

Name of the uploaded file

Size of the uploaded file in bytes

Web URL of the uploaded file