CosmosDBv3FunctionOptions interface
- Extends
-
CosmosDBv3TriggerOptions,Partial<FunctionOptions>
Properties
handler | |
retry | An optional retry policy to rerun a failed execution until either successful completion occurs or the maximum number of retries is reached. Learn more here |
trigger |
Inherited Properties
checkpoint |
Customizes the amount of documents between lease checkpoints. Default is after every function call. |
checkpoint |
When set, it defines, in milliseconds, the interval between lease checkpoints. Default is always after each Function call. |
collection |
The name of the collection being monitored |
connection |
An app setting (or environment variable) with the Cosmos DB connection string |
create |
Checks for existence and automatically creates the leases collection. Default is |
database |
The name of the Azure Cosmos DB database with the collection being monitored |
extra |
Configuration for an optional set of secondary inputs
During invocation, get these values with |
extra |
Configuration for an optional set of secondary outputs
During invocation, set these values with |
feed |
The time (in milliseconds) for the delay between polling a partition for new changes on the feed, after all current changes are drained. Default is 5,000 milliseconds, or 5 seconds. |
lease |
When set, it defines, in milliseconds, the interval to kick off a task to compute if partitions are distributed evenly among known host instances. Default is 13000 (13 seconds). |
lease |
The name of the collection to store leases. If not set, it will use "leases" |
lease |
When set, the value is added as a prefix to the leases created in the Lease collection for this function. Using a prefix allows two separate Azure Functions to share the same Lease collection by using different prefixes. |
lease |
When |
lease |
The name of an app setting that contains the connection string to the service which holds the lease collection.
If not set it will connect to the service defined by |
lease |
The name of the database that holds the collection to store leases. If not set, it will use the value of |
lease |
When set, it defines, in milliseconds, the interval for which the lease is taken on a lease representing a partition. If the lease is not renewed within this interval, it will cause it to expire and ownership of the partition will move to another instance. Default is 60000 (60 seconds). |
lease |
When set, it defines, in milliseconds, the renew interval for all leases for partitions currently held by an instance. Default is 17000 (17 seconds). |
max |
When set, this property sets the maximum number of items received per Function call. If operations in the monitored container are performed through stored procedures, transaction scope is preserved when reading items from the change feed. As a result, the number of items received could be higher than the specified value so that the items changed by the same transaction are returned as part of one atomic batch. |
preferred |
Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe |
return | Configuration for the optional primary output of the function This is the main output that you should set as the return value of the function handler during invocation |
start |
This option tells the Trigger to read changes from the beginning of the container's change history instead of starting at the current time. Reading from the beginning only works the first time the trigger starts, as in subsequent runs, the checkpoints are already stored. Setting this option to true when there are leases already created has no effect. |
use |
Enables multi-region accounts for writing to the leases collection. |
Property Details
handler
retry
An optional retry policy to rerun a failed execution until either successful completion occurs or the maximum number of retries is reached. Learn more here
retry?: RetryOptions
Property Value
trigger
Inherited Property Details
checkpointDocumentCount
Customizes the amount of documents between lease checkpoints. Default is after every function call.
checkpointDocumentCount?: number
Property Value
number
Inherited From CosmosDBv3TriggerOptions.checkpointDocumentCount
checkpointInterval
When set, it defines, in milliseconds, the interval between lease checkpoints. Default is always after each Function call.
checkpointInterval?: number
Property Value
number
Inherited From CosmosDBv3TriggerOptions.checkpointInterval
collectionName
The name of the collection being monitored
collectionName: string
Property Value
string
Inherited From CosmosDBv3TriggerOptions.collectionName
connectionStringSetting
An app setting (or environment variable) with the Cosmos DB connection string
connectionStringSetting: string
Property Value
string
Inherited From CosmosDBv3TriggerOptions.connectionStringSetting
createLeaseCollectionIfNotExists
Checks for existence and automatically creates the leases collection. Default is false
createLeaseCollectionIfNotExists?: boolean
Property Value
boolean
Inherited From CosmosDBv3TriggerOptions.createLeaseCollectionIfNotExists
databaseName
The name of the Azure Cosmos DB database with the collection being monitored
databaseName: string
Property Value
string
Inherited From CosmosDBv3TriggerOptions.databaseName
extraInputs
Configuration for an optional set of secondary inputs
During invocation, get these values with context.extraInputs.get()
extraInputs?: FunctionInput[]
Property Value
Inherited From Partial.extraInputs
extraOutputs
Configuration for an optional set of secondary outputs
During invocation, set these values with context.extraOutputs.set()
extraOutputs?: FunctionOutput[]
Property Value
Inherited From Partial.extraOutputs
feedPollDelay
The time (in milliseconds) for the delay between polling a partition for new changes on the feed, after all current changes are drained. Default is 5,000 milliseconds, or 5 seconds.
feedPollDelay?: number
Property Value
number
Inherited From CosmosDBv3TriggerOptions.feedPollDelay
leaseAcquireInterval
When set, it defines, in milliseconds, the interval to kick off a task to compute if partitions are distributed evenly among known host instances. Default is 13000 (13 seconds).
leaseAcquireInterval?: number
Property Value
number
Inherited From CosmosDBv3TriggerOptions.leaseAcquireInterval
leaseCollectionName
The name of the collection to store leases. If not set, it will use "leases"
leaseCollectionName?: string
Property Value
string
Inherited From CosmosDBv3TriggerOptions.leaseCollectionName
leaseCollectionPrefix
When set, the value is added as a prefix to the leases created in the Lease collection for this function. Using a prefix allows two separate Azure Functions to share the same Lease collection by using different prefixes.
leaseCollectionPrefix?: string
Property Value
string
Inherited From CosmosDBv3TriggerOptions.leaseCollectionPrefix
leaseCollectionThroughput
When createLeaseCollectionIfNotExists
is set to true
, defines the amount of Request Units to assign to the created lease collection
leaseCollectionThroughput?: number
Property Value
number
Inherited From CosmosDBv3TriggerOptions.leaseCollectionThroughput
leaseConnectionStringSetting
The name of an app setting that contains the connection string to the service which holds the lease collection.
If not set it will connect to the service defined by connectionStringSetting
leaseConnectionStringSetting?: string
Property Value
string
Inherited From CosmosDBv3TriggerOptions.leaseConnectionStringSetting
leaseDatabaseName
The name of the database that holds the collection to store leases. If not set, it will use the value of databaseName
leaseDatabaseName?: string
Property Value
string
Inherited From CosmosDBv3TriggerOptions.leaseDatabaseName
leaseExpirationInterval
When set, it defines, in milliseconds, the interval for which the lease is taken on a lease representing a partition. If the lease is not renewed within this interval, it will cause it to expire and ownership of the partition will move to another instance. Default is 60000 (60 seconds).
leaseExpirationInterval?: number
Property Value
number
Inherited From CosmosDBv3TriggerOptions.leaseExpirationInterval
leaseRenewInterval
When set, it defines, in milliseconds, the renew interval for all leases for partitions currently held by an instance. Default is 17000 (17 seconds).
leaseRenewInterval?: number
Property Value
number
Inherited From CosmosDBv3TriggerOptions.leaseRenewInterval
maxItemsPerInvocation
When set, this property sets the maximum number of items received per Function call. If operations in the monitored container are performed through stored procedures, transaction scope is preserved when reading items from the change feed. As a result, the number of items received could be higher than the specified value so that the items changed by the same transaction are returned as part of one atomic batch.
maxItemsPerInvocation?: number
Property Value
number
Inherited From CosmosDBv3TriggerOptions.maxItemsPerInvocation
preferredLocations
Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. Values should be comma-separated. For example, East US,South Central US,North Europe
preferredLocations?: string
Property Value
string
Inherited From CosmosDBv3TriggerOptions.preferredLocations
return
Configuration for the optional primary output of the function This is the main output that you should set as the return value of the function handler during invocation
return?: FunctionOutput
Property Value
Inherited From Partial.return
startFromBeginning
This option tells the Trigger to read changes from the beginning of the container's change history instead of starting at the current time. Reading from the beginning only works the first time the trigger starts, as in subsequent runs, the checkpoints are already stored. Setting this option to true when there are leases already created has no effect.
startFromBeginning?: boolean
Property Value
boolean
Inherited From CosmosDBv3TriggerOptions.startFromBeginning
useMultipleWriteLocations
Enables multi-region accounts for writing to the leases collection.
useMultipleWriteLocations?: boolean
Property Value
boolean
Inherited From CosmosDBv3TriggerOptions.useMultipleWriteLocations