Azure CreateItem

Azure CreateItem

Certified

Create one Cosmos document

Inserts a document into the container and returns the stored record, diagnostics, and RU charge. Fails on duplicate id within the partition.

yaml
type: io.kestra.plugin.azure.storage.cosmosdb.CreateItem
yaml
id: azure_cosmos_container_create_item
namespace: company.team

tasks:
  - id: create
    type: io.kestra.plugin.azure.storage.cosmosdb.CreateItem
    endpoint: "https://yourcosmosaccount.documents.azure.com"
    databaseId: your_data_base_id
    containerId: your_container_id
    tenantId: "{{ secret('AZURE_TENANT_ID') }}"
    clientId: "{{ secret('AZURE_CLIENT_ID') }}"
    clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
    item:
      id: item_id
      region: europe
      key: value
Properties

Container ID

Container (collection) name within the database; must already exist.

Database ID

Target database name inside the account; required.

Document body to create

JSON payload must include id and partition key fields expected by the container.

Azure AD tenant ID (GUID)

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 of the Azure AD application

Application (client) ID used for service principal authentication.

Client secret for the Azure AD application

Secret value associated with the client ID; store in a Kestra secret.

Cosmos connection string

Full connection string from Azure portal; overrides endpoint and Azure AD credentials when set.

DefaultSession
Possible Values
STRONGBOUNDED_STALENESSSESSIONEVENTUALCONSISTENT_PREFIX

Choose request consistency

Consistency level sent to Cosmos; defaults to SESSION.

Defaulttrue

Return payload on writes

When true (default), write responses include the document body; set false to reduce payload size.

Cosmos account endpoint

Base account URL (e.g. https://.documents.azure.com). Required when connectionString is absent.

PEM-encoded certificate content for client authentication

PEM text for certificate-based auth; alternative to clientSecret.

Activity id

Current resource quota usage

Diagnostics

Definitions
feedResponseDiagnostics
clientSideRequestStatisticsarray
activityIdstring
addressResolutionStatisticsobject
contactedReplicasarray
SubTypestring
diagnosticsClientConfig
failedReplicasarray
SubTypestring
gatewayStatisticsListarray
locationEndpointsContactedarray
SubTypestring
metadataDiagnosticsContext
regionsContactedarray
SubTypestring
requestEndTimeUTCstring
Formatdate-time
requestPayloadSizeInBytesinteger
requestStartTimeUTCstring
Formatdate-time
responseStatisticsListarray
retryContext
samplingRateSnapshotnumber
serializationDiagnosticsContext
supplementalResponseStatisticsListarray
diagnosticsContext
endTimeUTCstring
Formatdate-time
requestTimeline
startTimeUTCstring
Formatdate-time
queryMetricsMapobject
clientSideMetrics
documentLoadTimestring
Formatduration
documentWriteTimestring
Formatduration
indexHitDocumentCountinteger
indexLookupTimestring
Formatduration
indexUtilizationInfo
outputDocumentCountinteger
outputDocumentSizeinteger
queryPreparationTimes
retrievedDocumentCountinteger
retrievedDocumentSizeinteger
runtimeExecutionTimes
totalQueryExecutionTimestring
Formatduration
samplingRateSnapshotnumber
Formatduration

Duration

E tag

Item

Max resource quota

Request charge

SubTypestring

Response headers

Session token

Status code