Updating cosmos db 4.x extension bundle parameters (#188)
* Updating cosmos db 4.x extension bundle parameters * Updating tests * Updating pipeline
This commit is contained in:
Родитель
3f7a634283
Коммит
5fe66b0dbf
11
README.md
11
README.md
|
@ -1,13 +1,16 @@
|
|||
![Azure Functions Logo](https://raw.githubusercontent.com/Azure/azure-functions-cli/master/src/Azure.Functions.Cli/npm/assets/azure-functions-logo-color-raster.png)
|
||||
|
||||
|Branch|Status|
|
||||
|---|---|
|
||||
|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)|
|
||||
|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)|
|
||||
| Branch | Status |
|
||||
|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 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) |
|
||||
| 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) |
|
||||
|
||||
# Library for Azure Java Functions
|
||||
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.
|
||||
|
||||
### 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.
|
||||
### 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.
|
||||
|
||||
## azure-functions-maven plugin
|
||||
[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)
|
||||
|
||||
|
|
|
@ -5,11 +5,12 @@ trigger:
|
|||
branches:
|
||||
include:
|
||||
- dev
|
||||
- v2.x
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- dev
|
||||
- master
|
||||
- v2.x
|
||||
|
||||
|
||||
jobs:
|
||||
|
|
|
@ -83,7 +83,7 @@ Expand-Archive ".\Azure.Functions.Cli.zip" -DestinationPath ".\Azure.Functions.C
|
|||
$Env:Path = $Env:Path+";$currDir\Azure.Functions.Cli"
|
||||
|
||||
# Clone and build azure-functions-java-worker
|
||||
git clone https://github.com/azure/azure-functions-java-worker -b dev
|
||||
git clone https://github.com/azure/azure-functions-java-worker -b shreyasg/v4-extension-bundle
|
||||
Push-Location -Path "./azure-functions-java-worker" -StackName libraryDir
|
||||
Write-Host "Updating azure-functions-java-worker to use current version of the java library"
|
||||
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.microsoft.azure.functions</groupId>
|
||||
<artifactId>azure-functions-java-library</artifactId>
|
||||
<version>2.2.0</version>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<parent>
|
||||
<groupId>com.microsoft.maven</groupId>
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.lang.annotation.Target;
|
|||
* The following example shows a Java function that retrieves a single document.
|
||||
* The function is triggered by an HTTP request that uses a query string to
|
||||
* specify the ID to look up. That ID is used to retrieve a ToDoItem document
|
||||
* from the specified database and collection. A sample URL would be like:
|
||||
* from the specified database and container. A sample URL would be like:
|
||||
* http://localhost:7071/api/getItem?id=myid.
|
||||
* </p>
|
||||
*
|
||||
|
@ -40,9 +40,9 @@ import java.lang.annotation.Target;
|
|||
* authLevel = AuthorizationLevel.ANONYMOUS) Optional<String> dummy,
|
||||
* {@literal @}CosmosDBInput(name = "database",
|
||||
* databaseName = "ToDoList",
|
||||
* collectionName = "Items",
|
||||
* containerName = "Items",
|
||||
* id = "{Query.id}",
|
||||
* connectionStringSetting = "AzureCosmosDBConnection") Optional<String> item
|
||||
* connection = "AzureCosmosDBConnection") Optional<String> item
|
||||
* ) {
|
||||
* return item.orElse("Not found");
|
||||
* }
|
||||
|
@ -85,11 +85,11 @@ public @interface CosmosDBInput {
|
|||
String databaseName();
|
||||
|
||||
/**
|
||||
* Defines the collection name of the CosmosDB to which to bind.
|
||||
* Defines the container name of the CosmosDB to which to bind.
|
||||
*
|
||||
* @return The collection name string.
|
||||
* @return The container name string.
|
||||
*/
|
||||
String collectionName();
|
||||
String containerName();
|
||||
|
||||
/**
|
||||
* Defines the ID of the CosmosDB to which to bind.
|
||||
|
@ -110,7 +110,7 @@ public @interface CosmosDBInput {
|
|||
*
|
||||
* @return The app setting name of the connection string.
|
||||
*/
|
||||
String connectionStringSetting();
|
||||
String connection();
|
||||
|
||||
/**
|
||||
* Defines partition key value for the lookup. May include binding parameters.
|
||||
|
|
|
@ -33,8 +33,8 @@ import java.lang.annotation.Target;
|
|||
* public String cosmosDbAddItem(
|
||||
* {@literal @}HttpTrigger(name = "request", methods = {HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS)
|
||||
* final String message,
|
||||
* {@literal @}CosmosDBOutput(name = "database", databaseName = "ToDoList", collectionName = "Items",
|
||||
* connectionStringSetting = "AzureCosmosDBConnection")
|
||||
* {@literal @}CosmosDBOutput(name = "database", databaseName = "ToDoList", containerName = "Items",
|
||||
* connection = "AzureCosmosDBConnection")
|
||||
* ) {
|
||||
* return "{ \"id\": \"" + System.currentTimeMillis() + "\", \"description\": \"" + message + "\" }";
|
||||
* }
|
||||
|
@ -74,11 +74,11 @@ public @interface CosmosDBOutput {
|
|||
String databaseName();
|
||||
|
||||
/**
|
||||
* Defines the collection name of the CosmosDB to which to write.
|
||||
* Defines the container name of the CosmosDB to which to write.
|
||||
*
|
||||
* @return The collection name string.
|
||||
* @return The container name string.
|
||||
*/
|
||||
String collectionName();
|
||||
String containerName();
|
||||
|
||||
/**
|
||||
* Defines the ID of the CosmosDB to which to write.
|
||||
|
@ -92,22 +92,22 @@ public @interface CosmosDBOutput {
|
|||
*
|
||||
* @return The app setting name of the connection string.
|
||||
*/
|
||||
String connectionStringSetting();
|
||||
String connection();
|
||||
|
||||
/**
|
||||
* Defines the partition key path for the created collection when createIfNotExists is set to
|
||||
* Defines the partition key path for the created container when createIfNotExists is set to
|
||||
* true. May include binding parameters.
|
||||
*
|
||||
* @return partitionKey of the created collection.
|
||||
* @return partitionKey of the created container.
|
||||
*/
|
||||
String partitionKey() default "";
|
||||
|
||||
/**
|
||||
* If CreateIfNotExists is true, defines the throughput of the created collection.
|
||||
* If CreateIfNotExists is true, defines the throughput of the created container.
|
||||
*
|
||||
* @return Throughput of the created collection.
|
||||
* @return Throughput of the created container.
|
||||
*/
|
||||
int collectionThroughput() default -1;
|
||||
int containerThroughput() default -1;
|
||||
|
||||
/**
|
||||
* Enable to use with Multi Master accounts.
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.lang.annotation.Target;
|
|||
*
|
||||
* <p>
|
||||
* The following example shows a Java function that is invoked when there are inserts or updates in
|
||||
* the specified database and collection.
|
||||
* the specified database and container.
|
||||
* </p>
|
||||
*
|
||||
* <pre>
|
||||
|
@ -33,10 +33,10 @@ import java.lang.annotation.Target;
|
|||
* public void cosmosDbLog(
|
||||
* {@literal @}CosmosDBTrigger(name = "database",
|
||||
* databaseName = "ToDoList",
|
||||
* collectionName = "Items",
|
||||
* leaseCollectionName = "leases",
|
||||
* createLeaseCollectionIfNotExists = true,
|
||||
* connectionStringSetting = "AzureCosmosDBConnection")
|
||||
* containerName = "Items",
|
||||
* leaseContainerName = "leases",
|
||||
* createLeaseContainerIfNotExists = true,
|
||||
* connection = "AzureCosmosDBConnection")
|
||||
* List<Map<String, String>> items,
|
||||
* final ExecutionContext context
|
||||
* ) {
|
||||
|
@ -83,54 +83,54 @@ public @interface CosmosDBTrigger {
|
|||
String databaseName();
|
||||
|
||||
/**
|
||||
* Defines the collection name of the CosmosDB to which to bind.
|
||||
* Defines the container name of the CosmosDB to which to bind.
|
||||
*
|
||||
* @return The collection name string.
|
||||
* @return The container name string.
|
||||
*/
|
||||
String collectionName();
|
||||
String containerName();
|
||||
|
||||
/**
|
||||
* Defines Connection string for the service containing the lease collection.
|
||||
* Defines Connection string for the service containing the lease container.
|
||||
*
|
||||
* @return Connection string for the lease collection.
|
||||
* @return Connection string for the lease container.
|
||||
*/
|
||||
String leaseConnectionStringSetting() default "";
|
||||
|
||||
/**
|
||||
* Defines the lease collection name of the CosmosDB to which to bind.
|
||||
* Defines the lease container name of the CosmosDB to which to bind.
|
||||
*
|
||||
* @return The lease collection name string.
|
||||
* @return The lease container name string.
|
||||
*/
|
||||
String leaseCollectionName() default "";
|
||||
String leaseContainerName() default "";
|
||||
|
||||
/**
|
||||
* Defines Name of the database containing the lease collection.
|
||||
* Defines Name of the database containing the lease container.
|
||||
*
|
||||
* @return Name of the database for lease collection.
|
||||
* @return Name of the database for lease container.
|
||||
*/
|
||||
String leaseDatabaseName() default "";
|
||||
|
||||
/**
|
||||
* Defines whether to create a new lease collection if not exists.
|
||||
* Defines whether to create a new lease container if not exists.
|
||||
*
|
||||
* @return configuration whether to create a new lease collection if not exists.
|
||||
* @return configuration whether to create a new lease container if not exists.
|
||||
*/
|
||||
boolean createLeaseCollectionIfNotExists() default false;
|
||||
boolean createLeaseContainerIfNotExists() default false;
|
||||
|
||||
/**
|
||||
* defines the throughput of the created collection..
|
||||
* defines the throughput of the created container.
|
||||
*
|
||||
* @return throughput
|
||||
*/
|
||||
int leasesCollectionThroughput() default -1;
|
||||
int leasesContainerThroughput() default -1;
|
||||
|
||||
/**
|
||||
* Defines a prefix to be used within a Leases collection for this Trigger. Useful when sharing
|
||||
* the same Lease collection among multiple Triggers.
|
||||
* Defines a prefix to be used within a Leases container for this Trigger. Useful when sharing
|
||||
* the same Lease container among multiple Triggers.
|
||||
*
|
||||
* @return LeaseCollectionPrefix
|
||||
* @return LeaseContainerPrefix
|
||||
*/
|
||||
String leaseCollectionPrefix() default "";
|
||||
String leaseContainerPrefix() default "";
|
||||
|
||||
/**
|
||||
* Customizes the amount of milliseconds between lease checkpoints. Default is always after a
|
||||
|
@ -161,7 +161,7 @@ public @interface CosmosDBTrigger {
|
|||
*
|
||||
* @return The app setting name of the connection string.
|
||||
*/
|
||||
String connectionStringSetting();
|
||||
String connection();
|
||||
|
||||
/**
|
||||
* Customizes the renew interval in milliseconds for all leases for partitions currently held by
|
||||
|
|
Загрузка…
Ссылка в новой задаче