
Azure Query
CertifiedRun one Cosmos query
Azure Query
Run one Cosmos query
Executes a Cosmos SQL query with optional partition scope or feed range and returns the matching documents.
type: io.kestra.plugin.azure.storage.cosmosdb.QueryExamples
id: azure_storage_cosmos_query
namespace: company.team
tasks:
- id: bulk
type: io.kestra.plugin.azure.storage.cosmosdb.Query
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') }}"
query: "SELECT * FROM c WHERE c.region = 'europe'"
partitionKeyDefinition:
paths: ["/region"]
kind: HASH
version: V2
partitionKey:
region: europe
Properties
containerId *Requiredstring
Container ID
Container (collection) name within the database; must already exist.
databaseId *Requiredstring
Database ID
Target database name inside the account; required.
query *Requiredstring
SQL query string
tenantId *Requiredstring
Azure AD tenant ID (GUID)
clientId string
Client ID of the Azure AD application
Application (client) ID used for service principal authentication.
clientSecret string
Client secret for the Azure AD application
Secret value associated with the client ID; store in a Kestra secret.
connectionString string
Cosmos connection string
Full connection string from Azure portal; overrides endpoint and Azure AD credentials when set.
consistencyLevel string
SessionSTRONGBOUNDED_STALENESSSESSIONEVENTUALCONSISTENT_PREFIXChoose request consistency
Consistency level sent to Cosmos; defaults to SESSION.
contentResponseOnWriteEnabled booleanstring
trueReturn payload on writes
When true (default), write responses include the document body; set false to reduce payload size.
endpoint string
Cosmos account endpoint
Base account URL (e.g. https://
excludeRegions array
Regions to exclude
Regions to avoid for this query (e.g. "East US"). If all preferred regions are excluded, Cosmos falls back to the account primary region.
feedRangePartitionKey object
Feed range partition key values
Map of partition key path to value used to build a feed range (e.g. { "country": "US" }); requires partitionKeyDefinition and is mutually exclusive with partitionKey.
partitionKey object
Partition key values
Map of partition key path to value (e.g. { "country": "US" } for a /country key); requires partitionKeyDefinition.
partitionKeyDefinition string
Partition key definition (paths, kind, version)
Partition key schema (paths, kind, version); required with partitionKey or feedRangePartitionKey to build the correct PartitionKey.
io.kestra.plugin.azure.storage.cosmosdb.PartitionKeyDefinition
HASHRANGEMULTI_HASHPartitioning algorithm
Partition strategy, typically HASH, matching the container configuration.
Partition key paths
Ordered item property paths (e.g. [/pk]); each must start with '/'.
V1V2Partition key definition version
Version used when the container was created; choose the same value.
pemCertificate string
PEM-encoded certificate content for client authentication
PEM text for certificate-based auth; alternative to clientSecret.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
Outputs
queryResults array
Query results
Metrics
records.count counter
The total number of entities processed in the bulk operation.