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.
type: "io.kestra.plugin.microsoft365.oneshare.Upload"Examples
Upload a FILE input to OneDrive
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
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
driveId *Requiredstring
The ID of the drive.
fileName *Requiredstring
The name of the file to upload.
The desired filename in OneDrive/SharePoint. Can be different from the source filename.
from *Requiredstring
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.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
clientId string
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.
clientSecret string
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.
conflictBehavior string
REPLACEREPLACEFAILRENAMEConflict behavior when file exists.
Defines how to handle conflicts when a file with the same name already exists. Default: REPLACE
largeFileThreshold integerstring
4194304File 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
maxRetryAttempts integerstring
5Maximum number of retry attempts.
The maximum number of attempts to retry failed upload operations. Default: 5
maxSliceSize integerstring
3276800Maximum 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)
parentId string
rootThe ID of the parent folder.
The ID of the parent folder. If not provided, the root of the drive is used.
pemCertificate string
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.
tenantId string
Tenant ID
Outputs
file OneShareFile
The uploaded file metadata.