Upload a file to OneDrive or SharePoint.

Supports both small and large file uploads. Files larger than the threshold (default 4MB) will use resumable upload sessions for reliability and progress tracking.

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

The ID of the drive.

The name of the file to upload.

The desired filename in OneDrive/SharePoint. Can be different from the source filename.

The file from Kestra's internal storage to upload.

URI of the file in Kestra's internal storage. Can be from inputs, outputs, or 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.

Default REPLACE
Possible Values
REPLACEFAILRENAME

Conflict behavior when file exists.

Defines how to handle conflicts when a file with the same name already exists. Default: REPLACE

Default 4194304

File size threshold for using resumable upload.

Files larger than this threshold (in bytes) will use resumable upload sessions. Microsoft recommends 4MB (4194304 bytes) as the threshold. Default: 4MB

Default 5

Maximum number of retry attempts.

The maximum number of attempts to retry failed upload operations. Default: 5

Default 3276800

Maximum slice size for chunked uploads.

The size of each chunk when uploading large files (in bytes). Must be a multiple of 320 KiB (327,680 bytes). Default: 3.2 MB (3,276,800 bytes)

Default root

The ID of the parent folder.

The ID of the parent folder. If not provided, the root of the drive is used.

PEM Certificate

text
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.

Tenant ID

The uploaded file metadata.

Format date-time
Format date-time