@@ -186,21 +186,6 @@ This example requires the following `using` statements:
186
186
187
187
This function is invoked when there are inserts or updates in the specified database and container.
188
188
189
- # [ Functions 2.x+] ( #tab/functionsv2 )
190
-
191
- ``` java
192
- @FunctionName (" cosmosDBMonitor" )
193
- public void cosmosDbProcessor(
194
- @CosmosDBTrigger (name = " items" ,
195
- databaseName = " ToDoList" ,
196
- collectionName = " Items" ,
197
- leaseCollectionName = " leases" ,
198
- createLeaseCollectionIfNotExists = true ,
199
- connectionStringSetting = " AzureCosmosDBConnection" ) String [] items,
200
- final ExecutionContext context ) {
201
- context. getLogger(). info(items. length + " item(s) is/are changed." );
202
- }
203
- ```
204
189
# [ Extension 4.x+] ( #tab/extensionv4 )
205
190
206
191
[ !INCLUDE [ functions-cosmosdb-extension-java-note] ( ../../includes/functions-cosmosdb-extension-java-note.md )]
@@ -223,6 +208,22 @@ This function is invoked when there are inserts or updates in the specified data
223
208
}
224
209
```
225
210
211
+ # [ Functions 2.x+] ( #tab/functionsv2 )
212
+
213
+ ``` java
214
+ @FunctionName (" cosmosDBMonitor" )
215
+ public void cosmosDbProcessor(
216
+ @CosmosDBTrigger (name = " items" ,
217
+ databaseName = " ToDoList" ,
218
+ collectionName = " Items" ,
219
+ leaseCollectionName = " leases" ,
220
+ createLeaseCollectionIfNotExists = true ,
221
+ connectionStringSetting = " AzureCosmosDBConnection" ) String [] items,
222
+ final ExecutionContext context ) {
223
+ context. getLogger(). info(items. length + " item(s) is/are changed." );
224
+ }
225
+ ```
226
+
226
227
---
227
228
228
229
In the [ Java functions runtime library] ( /java/api/overview/azure/functions/runtime ) , use the ` @CosmosDBTrigger ` annotation on parameters whose value would come from Azure Cosmos DB. This annotation can be used with native Java types, POJOs, or nullable values using ` Optional<T> ` .
@@ -373,30 +374,6 @@ For Python functions defined by using *function.json*, see the [Configuration](#
373
374
::: zone pivot="programming-language-java"
374
375
## Annotations
375
376
376
- # [ Functions 2.x+] ( #tab/functionsv2 )
377
-
378
- From the [ Java functions runtime library] ( /java/api/overview/azure/functions/runtime ) , use the ` @CosmosDBTrigger ` annotation on parameters that read data from Azure Cosmos DB. The annotation supports the following properties:
379
-
380
- + [ name] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.name )
381
- + [ connectionStringSetting] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.connectionstringsetting )
382
- + [ databaseName] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.databasename )
383
- + [ collectionName] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.collectionname )
384
- + [ leaseConnectionStringSetting] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leaseconnectionstringsetting )
385
- + [ leaseDatabaseName] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leasedatabasename )
386
- + [ leaseCollectionName] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leasecollectionname )
387
- + [ createLeaseCollectionIfNotExists] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.createleasecollectionifnotexists )
388
- + [ leasesCollectionThroughput] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leasescollectionthroughput )
389
- + [ leaseCollectionPrefix] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leasecollectionprefix )
390
- + [ feedPollDelay] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.feedpolldelay )
391
- + [ leaseAcquireInterval] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leaseacquireinterval )
392
- + [ leaseExpirationInterval] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leaseexpirationinterval )
393
- + [ leaseRenewInterval] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leaserenewinterval )
394
- + [ checkpointInterval] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.checkpointinterval )
395
- + [ checkpointDocumentCount] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.checkpointdocumentcount )
396
- + [ maxItemsPerInvocation] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.maxitemsperinvocation )
397
- + [ startFromBeginning] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.startfrombeginning )
398
- + [ preferredLocations] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.preferredlocations )
399
-
400
377
# [ Extension 4.x+] ( #tab/extensionv4 )
401
378
402
379
[ !INCLUDE [ functions-cosmosdb-extension-java-note] ( ../../includes/functions-cosmosdb-extension-java-note.md )]
@@ -423,6 +400,30 @@ Use the `@CosmosDBTrigger` annotation on parameters that read data from Azure Co
423
400
| ** startFromBeginning** | (Optional) 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. |
424
401
| ** preferredLocations** | (Optional) 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". |
425
402
403
+ # [ Functions 2.x+] ( #tab/functionsv2 )
404
+
405
+ From the [ Java functions runtime library] ( /java/api/overview/azure/functions/runtime ) , use the ` @CosmosDBTrigger ` annotation on parameters that read data from Azure Cosmos DB. The annotation supports the following properties:
406
+
407
+ + [ name] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.name )
408
+ + [ connectionStringSetting] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.connectionstringsetting )
409
+ + [ databaseName] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.databasename )
410
+ + [ collectionName] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.collectionname )
411
+ + [ leaseConnectionStringSetting] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leaseconnectionstringsetting )
412
+ + [ leaseDatabaseName] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leasedatabasename )
413
+ + [ leaseCollectionName] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leasecollectionname )
414
+ + [ createLeaseCollectionIfNotExists] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.createleasecollectionifnotexists )
415
+ + [ leasesCollectionThroughput] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leasescollectionthroughput )
416
+ + [ leaseCollectionPrefix] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leasecollectionprefix )
417
+ + [ feedPollDelay] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.feedpolldelay )
418
+ + [ leaseAcquireInterval] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leaseacquireinterval )
419
+ + [ leaseExpirationInterval] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leaseexpirationinterval )
420
+ + [ leaseRenewInterval] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.leaserenewinterval )
421
+ + [ checkpointInterval] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.checkpointinterval )
422
+ + [ checkpointDocumentCount] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.checkpointdocumentcount )
423
+ + [ maxItemsPerInvocation] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.maxitemsperinvocation )
424
+ + [ startFromBeginning] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.startfrombeginning )
425
+ + [ preferredLocations] ( /java/api/com.microsoft.azure.functions.annotation.cosmosdbtrigger.preferredlocations )
426
+
426
427
---
427
428
428
429
::: zone-end
@@ -454,14 +455,14 @@ The following table explains the binding configuration properties that you set i
454
455
::: zone-end
455
456
::: zone pivot="programming-language-javascript,programming-language-typescript,programming-language-powershell,programming-language-python"
456
457
457
- # [ Functions 2.x+] ( #tab/functionsv2 )
458
-
459
- [ !INCLUDE [ functions-cosmosdb-settings-v3] ( ../../includes/functions-cosmosdb-settings-v3.md )]
460
-
461
458
# [ Extension 4.x+] ( #tab/extensionv4 )
462
459
463
460
[ !INCLUDE [ functions-cosmosdb-settings-v4] ( ../../includes/functions-cosmosdb-settings-v4.md )]
464
461
462
+ # [ Functions 2.x+] ( #tab/functionsv2 )
463
+
464
+ [ !INCLUDE [ functions-cosmosdb-settings-v3] ( ../../includes/functions-cosmosdb-settings-v3.md )]
465
+
465
466
---
466
467
467
468
::: zone-end
0 commit comments