Create a file or folder in OneDrive or SharePoint.

yaml
type: "io.kestra.plugin.microsoft365.oneshare.Create"

Create a folder in OneDrive

yaml
id: create_onedrive_folder
namespace: company.team

tasks:
  - id: create
    type: io.kestra.plugin.microsoft365.oneshare.Create
    tenantId: "{{ secret('TENANT_ID') }}"
    clientId: "{{ secret('CLIENT_ID') }}"
    clientSecret: "{{ secret('CLIENT_SECRET') }}"
    driveId: "b!abc123def456"
    parentId: "root"
    name: "new-folder"
    itemType: FOLDER

Create a text file with content

yaml
id: create_text_file
namespace: company.team

tasks:
  - id: create_file
    type: io.kestra.plugin.microsoft365.oneshare.Create
    tenantId: "{{ secret('TENANT_ID') }}"
    clientId: "{{ secret('CLIENT_ID') }}"
    clientSecret: "{{ secret('CLIENT_SECRET') }}"
    driveId: "b!abc123def456"
    parentId: "root"
    name: "readme.txt"
    content: "Hello World!"
Properties

The ID of the drive.

The name of the file or folder to create.

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.

Content of the file to create.

Default FILE
Possible Values
FILEFOLDER

Type of item to create.

Specify whether to create a FILE or FOLDER. Defaults to FILE.

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 created file or folder metadata.

Format date-time
Format date-time