
Microsoft 365 Upload
CertifiedUpload file to OneDrive or SharePoint
Microsoft 365 Upload
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.
type: io.kestra.plugin.microsoft365.oneshare.UploadExamples
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
Drive ID
OneDrive or SharePoint drive identifier required for all OneShare tasks
fileName *Requiredstring
Destination filename
Filename to create in OneDrive/SharePoint; can differ from source name
from *Requiredstring
Source file URI
URI in Kestra internal storage to upload (inputs/outputs/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
How to handle existing files: REPLACE (default), FAIL, or RENAME
largeFileThreshold integerstring
4194304Large file threshold
Bytes threshold to switch to resumable upload; default 4MB (4194304)
maxRetryAttempts integerstring
5Max retry attempts
Maximum retries for chunk uploads; default 5
maxSliceSize integerstring
3276800Max slice size
Chunk size in bytes for resumable upload; must be multiple of 320 KiB; default 3,276,800
parentId string
rootParent folder ID
Target folder ID; defaults to drive root
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.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
tenantId string
Tenant ID
Outputs
file
Uploaded file metadata