Microsoft 365 Create

Microsoft 365 Create

Certified

Create OneDrive/SharePoint file or folder

Creates a file (with optional text content) or empty folder in a drive. Defaults parent to root and itemType to FILE. Requires Microsoft Graph permissions Files.ReadWrite.All and Sites.ReadWrite.All.

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

Drive ID

OneDrive or SharePoint drive identifier required for all OneShare tasks

Item name

Filename or folder name 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.

File content

UTF-8 text to write when creating a file; ignored for folders; empty value creates zero-byte file

DefaultFILE
Possible Values
FILEFOLDER

Item type

FILE (default) creates a file; FOLDER creates a folder

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.

Reference (ref) of the pluginDefaults to apply to this task.

Tenant ID

Created item metadata

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