Skip to content

Commit 5fe66b0

Browse files
Updating cosmos db 4.x extension bundle parameters (#188)
* Updating cosmos db 4.x extension bundle parameters * Updating tests * Updating pipeline
1 parent 3f7a634 commit 5fe66b0

File tree

7 files changed

+54
-50
lines changed

7 files changed

+54
-50
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
![Azure Functions Logo](https://raw.githubusercontent.com/Azure/azure-functions-cli/master/src/Azure.Functions.Cli/npm/assets/azure-functions-logo-color-raster.png)
22

3-
|Branch|Status|
4-
|---|---|
5-
|master|[![Build status](https://ci.appveyor.com/api/projects/status/ebphtfegnposba6w?svg=true)](https://ci.appveyor.com/project/appsvc/azure-functions-java-library?branch=master)|
6-
|dev|[![Build status](https://ci.appveyor.com/api/projects/status/ebphtfegnposba6w?svg=true)](https://ci.appveyor.com/project/appsvc/azure-functions-java-library?branch=dev)|
3+
| Branch | Status |
4+
|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
5+
| dev | [![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-functions-java-library?branchName=dev)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=101&branchName=dev) |
6+
| v2.x | [![Build Status](https://azfunc.visualstudio.com/Azure%20Functions/_apis/build/status/Azure.azure-functions-java-library?branchName=v2.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=101&branchName=v2.x) |
77

88
# Library for Azure Java Functions
99
This repo contains library for building Azure Java Functions. Visit the [complete documentation of Azure Functions - Java Developer Guide](https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-java) for more details.
1010

11+
### The [dev](https://github.com/Azure/azure-functions-java-library/tree/dev) branch will be used to make any changes necessary to support v4 extension bundle.
12+
### The [v2.x](https://github.com/Azure/azure-functions-java-library/tree/v2.x) branch will be used to make any changes necessary to support v3 extension bundle.
13+
1114
## azure-functions-maven plugin
1215
[How to use azure-functions-maven plugin to create, update, deploy and test azure java functions](/learn/modules/develop-azure-functions-app-with-maven-plugin)
1316

azure-pipelines.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ trigger:
55
branches:
66
include:
77
- dev
8+
- v2.x
89
pr:
910
branches:
1011
include:
1112
- dev
12-
- master
13+
- v2.x
1314

1415

1516
jobs:

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Expand-Archive ".\Azure.Functions.Cli.zip" -DestinationPath ".\Azure.Functions.C
8383
$Env:Path = $Env:Path+";$currDir\Azure.Functions.Cli"
8484

8585
# Clone and build azure-functions-java-worker
86-
git clone https://github.com/azure/azure-functions-java-worker -b dev
86+
git clone https://github.com/azure/azure-functions-java-worker -b shreyasg/v4-extension-bundle
8787
Push-Location -Path "./azure-functions-java-worker" -StackName libraryDir
8888
Write-Host "Updating azure-functions-java-worker to use current version of the java library"
8989

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.microsoft.azure.functions</groupId>
66
<artifactId>azure-functions-java-library</artifactId>
7-
<version>2.2.0</version>
7+
<version>3.0.0-SNAPSHOT</version>
88
<packaging>jar</packaging>
99
<parent>
1010
<groupId>com.microsoft.maven</groupId>

src/main/java/com/microsoft/azure/functions/annotation/CosmosDBInput.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* The following example shows a Java function that retrieves a single document.
2929
* The function is triggered by an HTTP request that uses a query string to
3030
* specify the ID to look up. That ID is used to retrieve a ToDoItem document
31-
* from the specified database and collection. A sample URL would be like:
31+
* from the specified database and container. A sample URL would be like:
3232
* http://localhost:7071/api/getItem?id=myid.
3333
* </p>
3434
*
@@ -40,9 +40,9 @@
4040
* authLevel = AuthorizationLevel.ANONYMOUS) Optional&lt;String&gt; dummy,
4141
* {@literal @}CosmosDBInput(name = "database",
4242
* databaseName = "ToDoList",
43-
* collectionName = "Items",
43+
* containerName = "Items",
4444
* id = "{Query.id}",
45-
* connectionStringSetting = "AzureCosmosDBConnection") Optional&lt;String&gt; item
45+
* connection = "AzureCosmosDBConnection") Optional&lt;String&gt; item
4646
* ) {
4747
* return item.orElse("Not found");
4848
* }
@@ -85,11 +85,11 @@
8585
String databaseName();
8686

8787
/**
88-
* Defines the collection name of the CosmosDB to which to bind.
88+
* Defines the container name of the CosmosDB to which to bind.
8989
*
90-
* @return The collection name string.
90+
* @return The container name string.
9191
*/
92-
String collectionName();
92+
String containerName();
9393

9494
/**
9595
* Defines the ID of the CosmosDB to which to bind.
@@ -110,7 +110,7 @@
110110
*
111111
* @return The app setting name of the connection string.
112112
*/
113-
String connectionStringSetting();
113+
String connection();
114114

115115
/**
116116
* Defines partition key value for the lookup. May include binding parameters.

src/main/java/com/microsoft/azure/functions/annotation/CosmosDBOutput.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
* public String cosmosDbAddItem(
3434
* {@literal @}HttpTrigger(name = "request", methods = {HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS)
3535
* final String message,
36-
* {@literal @}CosmosDBOutput(name = "database", databaseName = "ToDoList", collectionName = "Items",
37-
* connectionStringSetting = "AzureCosmosDBConnection")
36+
* {@literal @}CosmosDBOutput(name = "database", databaseName = "ToDoList", containerName = "Items",
37+
* connection = "AzureCosmosDBConnection")
3838
* ) {
3939
* return "{ \"id\": \"" + System.currentTimeMillis() + "\", \"description\": \"" + message + "\" }";
4040
* }
@@ -74,11 +74,11 @@
7474
String databaseName();
7575

7676
/**
77-
* Defines the collection name of the CosmosDB to which to write.
77+
* Defines the container name of the CosmosDB to which to write.
7878
*
79-
* @return The collection name string.
79+
* @return The container name string.
8080
*/
81-
String collectionName();
81+
String containerName();
8282

8383
/**
8484
* Defines the ID of the CosmosDB to which to write.
@@ -92,22 +92,22 @@
9292
*
9393
* @return The app setting name of the connection string.
9494
*/
95-
String connectionStringSetting();
95+
String connection();
9696

9797
/**
98-
* Defines the partition key path for the created collection when createIfNotExists is set to
98+
* Defines the partition key path for the created container when createIfNotExists is set to
9999
* true. May include binding parameters.
100100
*
101-
* @return partitionKey of the created collection.
101+
* @return partitionKey of the created container.
102102
*/
103103
String partitionKey() default "";
104104

105105
/**
106-
* If CreateIfNotExists is true, defines the throughput of the created collection.
106+
* If CreateIfNotExists is true, defines the throughput of the created container.
107107
*
108-
* @return Throughput of the created collection.
108+
* @return Throughput of the created container.
109109
*/
110-
int collectionThroughput() default -1;
110+
int containerThroughput() default -1;
111111

112112
/**
113113
* Enable to use with Multi Master accounts.

src/main/java/com/microsoft/azure/functions/annotation/CosmosDBTrigger.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
*
2626
* <p>
2727
* The following example shows a Java function that is invoked when there are inserts or updates in
28-
* the specified database and collection.
28+
* the specified database and container.
2929
* </p>
3030
*
3131
* <pre>
3232
* {@literal @}FunctionName("cosmosDBMonitor")
3333
* public void cosmosDbLog(
3434
* {@literal @}CosmosDBTrigger(name = "database",
3535
* databaseName = "ToDoList",
36-
* collectionName = "Items",
37-
* leaseCollectionName = "leases",
38-
* createLeaseCollectionIfNotExists = true,
39-
* connectionStringSetting = "AzureCosmosDBConnection")
36+
* containerName = "Items",
37+
* leaseContainerName = "leases",
38+
* createLeaseContainerIfNotExists = true,
39+
* connection = "AzureCosmosDBConnection")
4040
* List&lt;Map&lt;String, String&gt;&gt; items,
4141
* final ExecutionContext context
4242
* ) {
@@ -83,54 +83,54 @@
8383
String databaseName();
8484

8585
/**
86-
* Defines the collection name of the CosmosDB to which to bind.
86+
* Defines the container name of the CosmosDB to which to bind.
8787
*
88-
* @return The collection name string.
88+
* @return The container name string.
8989
*/
90-
String collectionName();
90+
String containerName();
9191

9292
/**
93-
* Defines Connection string for the service containing the lease collection.
93+
* Defines Connection string for the service containing the lease container.
9494
*
95-
* @return Connection string for the lease collection.
95+
* @return Connection string for the lease container.
9696
*/
9797
String leaseConnectionStringSetting() default "";
9898

9999
/**
100-
* Defines the lease collection name of the CosmosDB to which to bind.
100+
* Defines the lease container name of the CosmosDB to which to bind.
101101
*
102-
* @return The lease collection name string.
102+
* @return The lease container name string.
103103
*/
104-
String leaseCollectionName() default "";
104+
String leaseContainerName() default "";
105105

106106
/**
107-
* Defines Name of the database containing the lease collection.
107+
* Defines Name of the database containing the lease container.
108108
*
109-
* @return Name of the database for lease collection.
109+
* @return Name of the database for lease container.
110110
*/
111111
String leaseDatabaseName() default "";
112112

113113
/**
114-
* Defines whether to create a new lease collection if not exists.
114+
* Defines whether to create a new lease container if not exists.
115115
*
116-
* @return configuration whether to create a new lease collection if not exists.
116+
* @return configuration whether to create a new lease container if not exists.
117117
*/
118-
boolean createLeaseCollectionIfNotExists() default false;
118+
boolean createLeaseContainerIfNotExists() default false;
119119

120120
/**
121-
* defines the throughput of the created collection..
121+
* defines the throughput of the created container.
122122
*
123123
* @return throughput
124124
*/
125-
int leasesCollectionThroughput() default -1;
125+
int leasesContainerThroughput() default -1;
126126

127127
/**
128-
* Defines a prefix to be used within a Leases collection for this Trigger. Useful when sharing
129-
* the same Lease collection among multiple Triggers.
128+
* Defines a prefix to be used within a Leases container for this Trigger. Useful when sharing
129+
* the same Lease container among multiple Triggers.
130130
*
131-
* @return LeaseCollectionPrefix
131+
* @return LeaseContainerPrefix
132132
*/
133-
String leaseCollectionPrefix() default "";
133+
String leaseContainerPrefix() default "";
134134

135135
/**
136136
* Customizes the amount of milliseconds between lease checkpoints. Default is always after a
@@ -161,7 +161,7 @@
161161
*
162162
* @return The app setting name of the connection string.
163163
*/
164-
String connectionStringSetting();
164+
String connection();
165165

166166
/**
167167
* Customizes the renew interval in milliseconds for all leases for partitions currently held by

0 commit comments

Comments
 (0)