MicrosoftOneShare Upload

MicrosoftOneShare 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 }}"
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-microsoft365 --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

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)

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

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.

Tenant ID

Uploaded file metadata

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