Skip to content

Commit 8723c77

Browse files
committed
make latest extension first tab
1 parent d532d03 commit 8723c77

File tree

1 file changed

+44
-43
lines changed

1 file changed

+44
-43
lines changed

articles/azure-functions/functions-bindings-cosmosdb-v2-trigger.md

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -186,21 +186,6 @@ This example requires the following `using` statements:
186186

187187
This function is invoked when there are inserts or updates in the specified database and container.
188188

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-
```
204189
# [Extension 4.x+](#tab/extensionv4)
205190

206191
[!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
223208
}
224209
```
225210

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+
226227
---
227228

228229
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](#
373374
::: zone pivot="programming-language-java"
374375
## Annotations
375376

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-
400377
# [Extension 4.x+](#tab/extensionv4)
401378

402379
[!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
423400
|**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. |
424401
|**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". |
425402

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+
426427
---
427428

428429
::: zone-end
@@ -454,14 +455,14 @@ The following table explains the binding configuration properties that you set i
454455
::: zone-end
455456
::: zone pivot="programming-language-javascript,programming-language-typescript,programming-language-powershell,programming-language-python"
456457

457-
# [Functions 2.x+](#tab/functionsv2)
458-
459-
[!INCLUDE [functions-cosmosdb-settings-v3](../../includes/functions-cosmosdb-settings-v3.md)]
460-
461458
# [Extension 4.x+](#tab/extensionv4)
462459

463460
[!INCLUDE [functions-cosmosdb-settings-v4](../../includes/functions-cosmosdb-settings-v4.md)]
464461

462+
# [Functions 2.x+](#tab/functionsv2)
463+
464+
[!INCLUDE [functions-cosmosdb-settings-v3](../../includes/functions-cosmosdb-settings-v3.md)]
465+
465466
---
466467

467468
::: zone-end

0 commit comments

Comments
 (0)