Create a file or folder in OneDrive or SharePoint.
type: "io.kestra.plugin.microsoft365.oneshare.Create"Examples
Create a folder in OneDrive
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
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
driveId *Requiredstring
The ID of the drive.
name *Requiredstring
The name of the file or folder to create.
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.
content string
Content of the file to create.
itemType string
FILEFILEFOLDERType of item to create.
Specify whether to create a FILE or FOLDER. Defaults to FILE.
parentId string
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 created file or folder metadata.