
Microsoft 365 Create
CertifiedCreate OneDrive/SharePoint file or folder
Microsoft 365 Create
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.
type: io.kestra.plugin.microsoft365.oneshare.CreateExamples
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
Drive ID
OneDrive or SharePoint drive identifier required for all OneShare tasks
name *Requiredstring
Item name
Filename or folder name 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
File content
UTF-8 text to write when creating a file; ignored for folders; empty value creates zero-byte file
itemType string
FILEFILEFOLDERItem type
FILE (default) creates a file; FOLDER creates a folder
parentId string
Parent 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
Created item metadata