Microsoft 365 Upload

Microsoft 365 Upload

Certified

Upload file to OneDrive or SharePoint

Uploads a file from Kestra internal storage. Uses simple PUT up to the threshold (default 4MB) and resumable upload sessions above it, with conflictBehavior defaulting to REPLACE. Requires Microsoft Graph permissions Files.ReadWrite.All and Sites.ReadWrite.All.

yaml
type: io.kestra.plugin.microsoft365.oneshare.Upload

Upload a FILE input to OneDrive

yaml
id: upload_to_onedrive
namespace: company.team

inputs:
  - id: file
    type: FILE

tasks:
  - id: upload
    type: io.kestra.plugin.microsoft365.oneshare.Upload
    tenantId: "{{ secret('TENANT_ID') }}"
    clientId: "{{ secret('CLIENT_ID') }}"
    clientSecret: "{{ secret('CLIENT_SECRET') }}"
    driveId: "b!abc123def456"
    parentId: "root"
    fileName: "uploaded-file.csv"
    from: "{{ inputs.file }}"

Download data and upload to OneDrive

yaml
id: download_and_upload
namespace: company.team

tasks:
  - id: download
    type: io.kestra.plugin.core.http.Download
    uri: https://example.com/data.csv

  - id: upload
    type: io.kestra.plugin.microsoft365.oneshare.Upload
    tenantId: "{{ secret('TENANT_ID') }}"
    clientId: "{{ secret('CLIENT_ID') }}"
    clientSecret: "{{ secret('CLIENT_SECRET') }}"
    driveId: "b!abc123def456"
    parentId: "root"
    fileName: "data.csv"
    from: "{{ outputs.download.uri }}"
Properties

Drive ID

OneDrive or SharePoint drive identifier required for all OneShare tasks

Destination filename

Filename to create in OneDrive/SharePoint; can differ from source name

Source file URI

URI in Kestra internal storage to upload (inputs/outputs/other tasks)

Client ID

Client ID of the Azure service principal. If you don't have a service principal, refer to create a service principal with Azure CLI.

Client Secret

Service principal client secret. Use this for Client Secret authentication. Provide clientId, tenantId, and clientSecret. Either clientSecret OR pemCertificate must be provided, not both.

DefaultREPLACE
Possible Values
REPLACEFAILRENAME

Conflict behavior

How to handle existing files: REPLACE (default), FAIL, or RENAME

Default4194304

Large file threshold

Bytes threshold to switch to resumable upload; default 4MB (4194304)

Default5

Max retry attempts

Maximum retries for chunk uploads; default 5

Default3276800

Max slice size

Chunk size in bytes for resumable upload; must be multiple of 320 KiB; default 3,276,800

Defaultroot

Parent folder ID

Target folder ID; defaults to drive root

PEM Certificate

Alternative authentication method using certificate-based authentication.
Use this for Client Certificate authentication. Provide clientId, tenantId, and pemCertificate.
Either clientSecret OR pemCertificate must be provided, not both.

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

Tenant ID

Uploaded file metadata

Definitions
createdDateTimestring
Formatdate-time
idstring
isFolderboolean
lastModifiedDateTimestring
Formatdate-time
mimeTypestring
namestring
sizeinteger
webUrlstring