* Update README
* Add Parent POM
* Fix Checkstyle errors
* Delete unsupported Mobile table annotaion
This commit is contained in:
Pragna Gopa 2018-11-08 15:18:35 -08:00 коммит произвёл GitHub
Родитель e2878e3e8c
Коммит 6e685d8e8a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
31 изменённых файлов: 913 добавлений и 847 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -31,3 +31,4 @@ hs_err_pid*
/azure-maven-plugins/
/ciTestDir/*
/target/
/Azure.Functions.Cli/*

Просмотреть файл

@ -1,5 +1,5 @@
# Microsoft Azure Functions API for Java
This project contains the Java API for building functions for the Azure Functions service. 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.
# 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.
## azure-functions-maven plugin
[How to use azure-functions-maven plugin to create, update, deploy and test azure java functions](https://docs.microsoft.com/en-us/java/api/overview/azure/maven/azure-functions-maven-plugin/readme?view=azure-java-stable)
@ -14,11 +14,11 @@ Please see for details on Parent POM https://github.com/Microsoft/maven-java-par
## Summary
Azure Functions is capable of running Function Apps that may contain one or more functions grouped. A function should be a stateless method to process input and produce output. Although you are allowed to write instance methods, your function must not depend on any instance fields of the class. You need to make sure all the function methods are `public` accessible.
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. You can write just the code you need for the problem at hand, without worrying about a whole application or the infrastructure to run it. Functions can make development even more productive.Pay only for the time your code runs and trust Azure to scale as needed. Azure Functions lets you develop [serverless](https://azure.microsoft.com/en-us/solutions/serverless/) applications on Microsoft Azure.
A deployable unit is an uber JAR containing one or more functions (see below), and a JSON file with the list of functions and triggers definitions, deployed to Azure Functions. The JAR can be created in many ways, although we recommend the use of the [Azure Functions Maven Plugin](https://docs.microsoft.com/en-us/java/api/overview/azure/maven/azure-functions-maven-plugin/readme), which also generates the JSON file for you automatically.
Azure Functions supports triggers, which are ways to start execution of your code, and bindings, which are ways to simplify coding for input and output data. A function should be a stateless method to process input and produce output. Although you are allowed to write instance methods, your function must not depend on any instance fields of the class. You need to make sure all the function methods are `public` accessible and method with annotation @FunctionName is unique as that defines the entry for the the function.
Typically a function is invoked because of a trigger. Your function needs to process that trigger (sometimes with additional inputs) and provide an optional output.
A deployable unit is an uber JAR containing one or more functions (see below), and a JSON file with the list of functions and triggers definitions, deployed to Azure Functions. The JAR can be created in many ways, although we recommend [Azure Functions Maven Plugin](https://docs.microsoft.com/en-us/java/api/overview/azure/maven/azure-functions-maven-plugin/readme), as it provides templates to get you started with key scenarios.
All the input and output bindings can be defined in `function.json` (not recommended), or in the Java method by using annotations (recommended). All the types and annotations used in this document are included in the `azure-functions-java-library` package.
@ -32,7 +32,7 @@ package com.example;
import com.microsoft.azure.functions.annotation.*;
public class MyClass {
public class Function {
@FunctionName("echo")
public static String echo(@HttpTrigger(name = "req", methods = { "post" }, authLevel = AuthorizationLevel.ANONYMOUS) String in) {
return "Hello, " + in + ".";
@ -52,7 +52,7 @@ You are free to use all the data types in Java for the input and output data, in
The POJO types (Java classes) you may define have to be publicly accessible (`public` modifier). POJO properties/fields may be `private`. For example a JSON string `{ "x": 3 }` is able to be converted to the following POJO type:
```java
public class MyData {
public class PojoData {
private int x;
}
```
@ -74,39 +74,45 @@ package com.example;
import com.microsoft.azure.functions.annotation.*;
public class MyClass {
public class Function {
@FunctionName("echo")
public String echo(
@HttpTrigger(name = "req", methods = { "put" }, authLevel = AuthorizationLevel.ANONYMOUS, route = "items/{id}") String in,
@TableInput(name = "item", tableName = "items", partitionKey = "example", rowKey = "{id}", connection = "AzureWebJobsStorage") MyObject obj
@TableInput(name = "item", tableName = "items", partitionKey = "example", rowKey = "{id}", connection = "AzureWebJobsStorage") TestInputData inputData
) {
return "Hello, " + in + " and " + obj.getRowKey() + ".";
return "Hello, " + in + " and " + inputData.getRowKey() + ".";
}
}
public class MyObject {
public class TestInputData {
public String getRowKey() { return this.rowKey; }
private String rowKey;
}
```
When this function is invoked, the HTTP request payload will be passed as the `String` for argument `in`; and one entry will be retrieved from the Azure Table Storage and be passed to argument `obj` as `MyObject` type.
When this function is invoked, the HTTP request payload will be passed as the `String` for argument `in`; and one entry will be retrieved from the Azure Table Storage and be passed to argument `inputData` as `TestInputData` type.
To receive events in a batch when using EventHubTrigger, set cardinality to many and change input type to List<>
To receive events in a batch when using EventHubTrigger, set cardinality to many and change input type to an array or List<>
```Java
```java
@FunctionName("ProcessIotMessages")
public void processIotMessages(
@EventHubTrigger(name = "message", eventHubName = "%AzureWebJobsEventHubPath%", connection = "AzureWebJobsEventHubSender", cardinality = Cardinality.MANY) List<String> messages,
@EventHubTrigger(name = "message", eventHubName = "%AzureWebJobsEventHubPath%", connection = "AzureWebJobsEventHubSender", cardinality = Cardinality.MANY) List<TestEventData> messages,
final ExecutionContext context)
{
context.getLogger().info("Java Event Hub trigger received messages. Batch size: " + messages.size());
}
public class TestEventData {
public String id;
}
```
Note: You can also bind to String[], TestEventData[] or List<String>
## Outputs
Outputs can be expressed in return value or output parameters. If there is only one output, you are recommended to use the return value. For multiple outputs, you have to use **output parameters**.
@ -120,7 +126,7 @@ package com.example;
import com.microsoft.azure.functions.annotation.*;
public class MyClass {
public class Function {
@FunctionName("copy")
@StorageAccount("AzureWebJobsStorage")
@BlobOutput(name = "$return", path = "samples-output-java/{name}")
@ -138,7 +144,7 @@ package com.example;
import com.microsoft.azure.functions.*;
import com.microsoft.azure.functions.annotation.*;
public class MyClass {
public class Function {
@FunctionName("push")
public String push(
@HttpTrigger(name = "req", methods = { "post" }, authLevel = AuthorizationLevel.ANONYMOUS) String body,
@ -164,7 +170,7 @@ package com.example;
import com.microsoft.azure.functions.*;
import com.microsoft.azure.functions.annotation.*;
public class MyClass {
public class Function {
@FunctionName("heartbeat")
public static void heartbeat(
@TimerTrigger(name = "schedule", schedule = "*/30 * * * * *") String timerInfo,
@ -185,7 +191,7 @@ Sometimes a function need to take a more detailed control of the input and outpu
| Specialized Type | Target | Typical Usage |
| ------------------------ | :-----------------: | ------------------------------ |
| `HttpRequestMessage<T>` | HTTP Trigger | Get method, headers or queries |
| `HttpResponseMessage<T>` | HTTP Output Binding | Return status other than 200 |
| `HttpResponseMessage` | HTTP Output Binding | Return status other than 200 |
### Metadata
@ -193,13 +199,13 @@ Metadata comes from different sources, like HTTP headers, HTTP queries, and [tri
For example, the `queryValue` in the following code snippet will be `"test"` if the requested URL is `http://{example.host}/api/metadata?name=test`.
```Java
```java
package com.example;
import java.util.Optional;
import com.microsoft.azure.functions.annotation.*;
public class MyClass {
public class Function {
@FunctionName("metadata")
public static String metadata(
@HttpTrigger(name = "req", methods = { "get", "post" }, authLevel = AuthorizationLevel.ANONYMOUS) Optional<String> body,

Просмотреть файл

@ -16,9 +16,7 @@ environment:
install:
- cmd: echo %JAVA_HOME%
- ps: Get-Command mvn
- cmd: mvn -v
- cmd: npm i -g azure-functions-core-tools
- ps: Get-Command mvn
build_script:
- ps: '& .\build.ps1'

Просмотреть файл

@ -48,12 +48,40 @@ $libraryPom -match "<version>(.*)</version>"
$libraryVersion = $matches[1]
Write-Host "libraryVersion: " $libraryVersion
# Download azure-functions-core-tools
$currDir = Get-Location
$skipCliDownload = $false
if($args[0])
{
$skipCliDownload = $args[0]
}
Write-Host "skipCliDownload" $skipCliDownload
if(!$skipCliDownload)
{
Write-Host "Deleting Functions Core Tools if exists...."
Remove-Item -Force ./Azure.Functions.Cli.zip -ErrorAction Ignore
Remove-Item -Recurse -Force ./Azure.Functions.Cli -ErrorAction Ignore
Write-Host "Downloading Functions Core Tools...."
Invoke-RestMethod -Uri 'https://functionsclibuilds.blob.core.windows.net/builds/2/latest/version.txt' -OutFile version.txt
Write-Host "Using Functions Core Tools version: $(Get-Content -Raw version.txt)"
Remove-Item version.txt
$url = "https://functionsclibuilds.blob.core.windows.net/builds/2/latest/Azure.Functions.Cli.win-x86.zip"
$output = "$currDir\Azure.Functions.Cli.zip"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $output)
Write-Host "Extracting Functions Core Tools...."
Expand-Archive ".\Azure.Functions.Cli.zip" -DestinationPath ".\Azure.Functions.Cli"
}
$Env:Path = $Env:Path+";$currDir\Azure.Functions.Cli"
# Generate HttpTrigger Function via archetype version built above
md -Name ciTestDir
Push-Location -Path "./ciTestDir" -StackName libraryDir
Write-Host "Generating project with archetype"
mvn archetype:generate -DarchetypeCatalog="local" -DarchetypeGroupId="com.microsoft.azure" -DarchetypeArtifactId="azure-functions-archetype" -DarchetypeVersion="$atchetypeVersion" -DgroupId="com.microsoft" -DartifactId="e2etestproject" -Dversion="1.0-SNAPSHOT" -Dpackage="com.microsoft" -DappRegion="westus" -DresourceGroup="e2etest-java-functions-group" -DappName="e2etest-java-functions" -B
StopOnFailedExecution
cmd.exe /c '.\..\mvnGenerateArchetype.bat' $atchetypeVersion
Pop-Location -StackName "libraryDir"
#Build HttpTrigger Function
@ -63,7 +91,7 @@ Remove-Item -Recurse -Force "src/test" -ErrorAction Ignore
cmd.exe /c .\..\..\updateVersions.bat $libraryVersion $pluginVersion
StopOnFailedExecution
#Update versions in the HttpTrigger pom.xml
mvn clean package -DskipTests
cmd.exe /c '.\..\..\mvnBuild.bat'
StopOnFailedExecution
Pop-Location -StackName "libraryDir"

3
mvnGenerateArchetype.bat Normal file
Просмотреть файл

@ -0,0 +1,3 @@
set atchetypeVersion=%1
mvn archetype:generate -DarchetypeCatalog="local" -DarchetypeGroupId="com.microsoft.azure" -DarchetypeArtifactId="azure-functions-archetype" -DarchetypeVersion="%atchetypeVersion%" -DgroupId="com.microsoft" -DartifactId="e2etestproject" -Dversion="1.0-SNAPSHOT" -Dpackage="com.microsoft" -DappRegion="westus" -DresourceGroup="e2etest-java-functions-group" -DappName="e2etest-java-functions" -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B

260
pom.xml
Просмотреть файл

@ -1,133 +1,145 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>1.0.0-beta-7-SNAPSHOT</version>
<packaging>jar</packaging>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library</artifactId>
<version>1.2.0</version>
<packaging>jar</packaging>
<parent>
<groupId>com.microsoft.maven</groupId>
<artifactId>java-8-parent</artifactId>
<version>8.0.0-SNAPSHOT</version>
</parent>
<name>Microsoft Azure Functions Java Core Types</name>
<description>This package contains all Java interfaces and annotations to interact with Microsoft Azure functions runtime.</description>
<url>https://azure.microsoft.com/en-us/services/functions</url>
<name>Microsoft Azure Functions Java Core Types</name>
<description>This package contains all Java interfaces and annotations to interact with Microsoft Azure functions runtime.</description>
<url>https://azure.microsoft.com/en-us/services/functions</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>4.12</junit.version>
<mockito.version>2.11.0</mockito.version>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:https://github.com/Azure/azure-functions-java-worker</connection>
<developerConnection>scm:git:git@github.com:Azure/azure-functions-java-worker</developerConnection>
<url>https://github.com/Azure/azure-functions-java-worker</url>
<tag>HEAD</tag>
</scm>
<scm>
<connection>scm:git:https://github.com/Azure/azure-functions-java-worker</connection>
<developerConnection>scm:git:git@github.com:Azure/azure-functions-java-worker</developerConnection>
<url>https://github.com/Azure/azure-functions-java-worker</url>
<tag>HEAD</tag>
</scm>
<developers>
<developer>
<id>junyi</id>
<name>Junyi Yi</name>
<email>junyi@microsoft.com</email>
</developer>
<developer>
<id>xscript</id>
<name>Kevin Zhao</name>
<email>kevinzha@microsoft.com</email>
</developer>
</developers>
<developers>
<developer>
<id>pgopa</id>
<name>Pragna Gopa</name>
<email>pgopa@microsoft.com</email>
</developer>
<developer>
<id>xscript</id>
<name>Kevin Zhao</name>
<email>kevinzha@microsoft.com</email>
</developer>
</developers>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<uniqueVersion>true</uniqueVersion>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<dependencies>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<uniqueVersion>true</uniqueVersion>
<layout>default</layout>
</snapshotRepository>
</distributionManagement>
<!-- test -->
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<repositories>
<repository>
<id>maven.snapshots</id>
<name>Maven Central Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</dependencies>
<dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<configuration>
<workingDirectory>${project.build.directory}</workingDirectory>
<systemProperties>
<property>
<name>testing-project-jar</name>
<value>${project.artifactId}-${project.version}-tests.jar</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</project>
<!-- test -->
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.2.0</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<workingDirectory>${project.build.directory}</workingDirectory>
<systemProperties>
<property>
<name>testing-project-jar</name>
<value>${project.artifactId}-${project.version}-tests.jar</value>
</property>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</project>

Просмотреть файл

@ -0,0 +1,48 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions;
/**
* A builder to create an instance of HttpResponseMessage
*/
public interface Builder {
/**
* Sets the status code to be used in the HttpResponseMessage object.
*
* You can provide standard HTTP Status using enum values from {@link HttpStatus}, or you can
* create a custom status code using {@link HttpStatusType#custom(int)}.
*
* @param status An HTTP status code representing the outcome of the HTTP request.
* @return this builder
*/
Builder status(HttpStatusType status);
/**
* Adds a (key, value) header to the response.
*
* @param key The key of the header value.
* @param value The value of the header value.
* @return this builder
*/
Builder header(String key, String value);
/**
* Sets the body of the HTTP response.
*
* @param body The body of the HTTP response
* @return this builder
*/
Builder body(Object body);
/**
* Creates an instance of HttpMessageResponse with the values configured in this builder.
*
* @return an HttpMessageResponse object
*/
HttpResponseMessage build();
}

Просмотреть файл

@ -1,3 +1,9 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions;
import java.util.logging.Logger;

Просмотреть файл

@ -1,21 +1,30 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions;
/**
* Enum for HTTP methods in the HTTP Binding of Azure Functions.
*
* @author Bruno Borges
*/
public enum HttpMethod {
GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE;
import java.util.Locale;
/**
* Converts passed value to upper case to extract valueOf() of this Enum.
* @param value of http method in any case
* @return this enum
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See
* License.txt in the project root for license information.
*/
public enum HttpMethod {
GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE;
/**
* Converts passed value to upper case to extract valueOf() of this Enum.
*
* @param value of http method in any case
* @return this enum
*/
public static HttpMethod value(String value) {
return HttpMethod.valueOf(value.toUpperCase());
return HttpMethod.valueOf(value.toUpperCase(Locale.ROOT));
}
}

Просмотреть файл

@ -11,60 +11,70 @@ import java.util.Map;
/**
* An HttpRequestMessage instance is provided to Azure functions that use
* {@link com.microsoft.azure.functions.annotation.HttpTrigger HTTP Triggers}. For an example of how to use
* the http functionality of Azure Functions, refer to the example in the
* {@link com.microsoft.azure.functions.annotation.HttpTrigger HTTP Triggers}. For an example of how
* to use the http functionality of Azure Functions, refer to the example in the
* {@link com.microsoft.azure.functions.annotation.HttpTrigger}
*
* @see com.microsoft.azure.functions.annotation.HttpTrigger
* @see HttpResponseMessage
* @param <T> The type of the body content that is expected to be received as part of this HTTP request.
* @param <T> The type of the body content that is expected to be received as part of this HTTP
* request.
* @since 1.0.0
*/
public interface HttpRequestMessage<T> {
/**
* Returns the URI that was called that resulted in this HTTP request being submitted.
*
* @return the URI that was called that resulted in this HTTP request being submitted.
*/
URI getUri();
/**
* Returns the HTTP method name as Enum
* @return type of HttpMethod
*
* @return type of HttpMethod
*/
HttpMethod getHttpMethod();
/**
* Returns a map of headers that were contained within this HTTP request.
*
* @return a map of headers that were contained within this HTTP request.
*/
Map<String, String> getHeaders();
/**
* Returns a map of query parameters that were included with this HTTP request.
*
* @return a map of query parameters that were included with this HTTP request.
*/
Map<String, String> getQueryParameters();
/**
* Returns any body content that was included with this HTTP request.
*
* @return any body content that was included with this HTTP request.
*/
T getBody();
/**
* Returns a {@link HttpResponseMessage.Builder} instance to build a HttpResponseMessage with standard HTTP status code and no response body.
/**
* Returns a {@link Builder} instance to build a HttpResponseMessage with
* standard HTTP status code and no response body.
*
* @param status The HTTP status code to return to the caller of the function.
* @return An {@link HttpResponseMessage.Builder} instance containing the provided status and empty body.
* @return An {@link Builder} instance containing the provided status and
* empty body.
*/
HttpResponseMessage.Builder createResponseBuilder(HttpStatus status);
Builder createResponseBuilder(HttpStatus status);
/**
* Returns a {@link HttpResponseMessage.Builder} instance to build a HttpResponseMessage with custome HTTP status code and no response body.
* Returns a {@link Builder} instance to build a HttpResponseMessage with
* custome HTTP status code and no response body.
*
* @param status The HTTP status code to return to the caller of the function.
* @return An {@link HttpResponseMessage.Builder} instance containing the provided status and empty body.
* @return An {@link Builder} instance containing the provided status and
* empty body.
*/
HttpResponseMessage.Builder createResponseBuilder(HttpStatusType status);
Builder createResponseBuilder(HttpStatusType status);
}

Просмотреть файл

@ -1,6 +1,7 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See
* License.txt in the project root for license information.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions;
@ -45,48 +46,4 @@ public interface HttpResponseMessage {
* @return the body of the HTTP response.
*/
Object getBody();
/**
* A builder to create an instance of HttpResponseMessage
*
* @author Bruno Borges
* @since 1.0
*/
public static interface Builder {
/**
* Sets the status code to be used in the HttpResponseMessage object.
*
* You can provide standard HTTP Status using enum values from {@link HttpStatus}, or
* you can create a custom status code using {@link HttpStatusType#custom(int)}.
*
* @param status An HTTP status code representing the outcome of the HTTP request.
* @return this builder
*/
Builder status(HttpStatusType status);
/**
* Adds a (key, value) header to the response.
*
* @param key The key of the header value.
* @param value The value of the header value.
* @return this builder
*/
Builder header(String key, String value);
/**
* Sets the body of the HTTP response.
*
* @param body The body of the HTTP response
* @return this builder
*/
Builder body(Object body);
/**
* Creates an instance of HttpMessageResponse with the values configured in this builder.
*
* @return an HttpMessageResponse object
*/
HttpResponseMessage build();
}
}

Просмотреть файл

@ -63,11 +63,12 @@ public enum HttpStatus implements HttpStatusType {
* @return HttpStatus enum
*/
public static HttpStatus valueOf(int value) {
for (HttpStatus status : HttpStatus.values()) {
if (value == status.value)
for (final HttpStatus status : HttpStatus.values()) {
if (value == status.value) {
return status;
}
}
throw new IllegalArgumentException("HTTP Status code unknown: " + value);
}
}
}

Просмотреть файл

@ -1,3 +1,9 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions;
/**

Просмотреть файл

@ -1,3 +1,9 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions;
/**

Просмотреть файл

@ -1,3 +1,9 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions.annotation;
import java.lang.annotation.ElementType;
@ -6,18 +12,21 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>Place this on a parameter whose value would come from Azure Functions runtime.
* Use this annotation when you want to get the value of trigger metadata, or when you defined your own bindings in
* function.json manually.</p>
* <p>
* Place this on a parameter whose value would come from Azure Functions runtime. Use this
* annotation when you want to get the value of trigger metadata, or when you defined your own
* bindings in function.json manually.
* </p>
*
* @since 1.0.0
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
public @interface BindingName {
/**
* Defines the trigger metadata name or binding name defined in function.json.
* @return The trigger metadata name or binding name.
*/
String value();
/**
* Defines the trigger metadata name or binding name defined in function.json.
*
* @return The trigger metadata name or binding name.
*/
String value();
}

Просмотреть файл

@ -7,18 +7,21 @@
package com.microsoft.azure.functions.annotation;
/**
* <p>Cardinality of the EventHubTrigger input. Choose 'ONE' if the input is a single message or 'Many' if the input is an array of messages. 'Many' is the default if unspecified</p>
* <p>
* Cardinality of the EventHubTrigger input. Choose 'ONE' if the input is a single message or 'Many'
* if the input is an array of messages. 'Many' is the default if unspecified
* </p>
*
* @since 1.0.0
*/
public enum Cardinality {
/**
* To receive a single message, set cardinality to ONE
*/
ONE,
/**
* To receive a single message, set cardinality to ONE
*/
ONE,
/**
* To receive events in a batch, set cardinality to MANY. This is the default if omitted.
*/
MANY
/**
* To receive events in a batch, set cardinality to MANY. This is the default if omitted.
*/
MANY
}

Просмотреть файл

@ -13,8 +13,8 @@ import java.lang.annotation.Target;
/**
* <p>
* Place this on a parameter whose value would be written to CosmosDB. The
* parameter type should be OutputBinding&lt;T&gt;, where T could be one of:
* Place this on a parameter whose value would be written to CosmosDB. The parameter type should be
* OutputBinding&lt;T&gt;, where T could be one of:
* </p>
*
* <ul>
@ -23,15 +23,18 @@ import java.lang.annotation.Target;
* </ul>
*
* <p>
* The following example shows a Java function that adds a document to a
* database, using data provided in the body of an HTTP Post request.
* The following example shows a Java function that adds a document to a database, using data
* provided in the body of an HTTP Post request.
* </p>
*
* <pre>
* {@literal @}FunctionName("addItem")
*{@literal @}CosmosDBOutput(name = "database", databaseName = "ToDoList", collectionName = "Items", connectionStringSetting = "AzureCosmosDBConnection")
*
* public String cosmosDbAddItem(
* {@literal @}HttpTrigger(name = "request", methods = {HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS) final String message
* {@literal @}HttpTrigger(name = "request", methods = {HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS)
* final String message,
* {@literal @}CosmosDBOutput(name = "database", databaseName = "ToDoList", collectionName = "Items",
* connectionStringSetting = "AzureCosmosDBConnection")
* ) {
* return "{ \"id\": \"" + System.currentTimeMillis() + "\", \"description\": \"" + message + "\" }";
* }
@ -42,86 +45,83 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PARAMETER, ElementType.METHOD })
public @interface CosmosDBOutput {
/**
* The variable name used in function.json.
*
* @return The variable name used in function.json.
*/
String name();
/**
* The variable name used in function.json.
*
* @return The variable name used in function.json.
*/
String name();
/**
* <p>
* Defines how Functions runtime should treat the parameter value. Possible
* values are:
* </p>
* <ul>
* <li>"" or string: treat it as a string whose value is serialized from the
* parameter</li>
* <li>binary: treat it as a binary data whose value comes from for example
* OutputBinding&lt;byte[]&gt;</li>
* </ul>
*
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* <p>
* Defines how Functions runtime should treat the parameter value. Possible values are:
* </p>
* <ul>
* <li>"" or string: treat it as a string whose value is serialized from the parameter</li>
* <li>binary: treat it as a binary data whose value comes from for example
* OutputBinding&lt;byte[]&gt;</li>
* </ul>
*
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* Defines the database name of the CosmosDB to which to write.
*
* @return The database name string.
*/
String databaseName();
/**
* Defines the database name of the CosmosDB to which to write.
*
* @return The database name string.
*/
String databaseName();
/**
* Defines the collection name of the CosmosDB to which to write.
*
* @return The collection name string.
*/
String collectionName();
/**
* Defines the collection name of the CosmosDB to which to write.
*
* @return The collection name string.
*/
String collectionName();
/**
* Defines the ID of the CosmosDB to which to write.
*
* @return The ID string.
*/
boolean createIfNotExists() default false;
/**
* Defines the ID of the CosmosDB to which to write.
*
* @return The ID string.
*/
boolean createIfNotExists() default false;
/**
* Defines the app setting name that contains the CosmosDB connection string.
*
* @return The app setting name of the connection string.
*/
String connectionStringSetting();
/**
* Defines the app setting name that contains the CosmosDB connection string.
*
* @return The app setting name of the connection string.
*/
String connectionStringSetting();
/**
* Defines the partition key path for the created collection when
* createIfNotExists is set to true. May include binding parameters.
*
* @return partitionKey of the created collection.
*/
String partitionKey() default "";
/**
* Defines the partition key path for the created collection when createIfNotExists is set to
* true. May include binding parameters.
*
* @return partitionKey of the created collection.
*/
String partitionKey() default "";
/**
* If CreateIfNotExists is true, defines the throughput of the created
* collection.
*
* @return Throughput of the created collection.
*/
int collectionThroughput() default -1;
/**
* If CreateIfNotExists is true, defines the throughput of the created collection.
*
* @return Throughput of the created collection.
*/
int collectionThroughput() default -1;
/**
* Enable to use with Multi Master accounts.
*
* @return whether to Multi Master accounts
*/
boolean useMultipleWriteLocations() default false;
/**
* Enable to use with Multi Master accounts.
*
* @return whether to Multi Master accounts
*/
boolean useMultipleWriteLocations() default false;
/**
* Defines preferred locations (regions) for geo-replicated database accounts in
* the Azure Cosmos DB service. Values should be comma-separated. example,
* PreferredLocations = "East US,South Central US,North Europe"
*
* @return PreferredLocations for geo-replicated database accounts
*/
String preferredLocations() default "";
/**
* Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos
* DB service. Values should be comma-separated. example, PreferredLocations = "East US,South
* Central US,North Europe"
*
* @return PreferredLocations for geo-replicated database accounts
*/
String preferredLocations() default "";
}

Просмотреть файл

@ -13,9 +13,8 @@ import java.lang.annotation.Target;
/**
* <p>
* Place this on a parameter whose value would come from CosmosDB, and causing
* the method to run when CosmosDB data is changed. The parameter type can be
* one of the following:
* Place this on a parameter whose value would come from CosmosDB, and causing the method to run
* when CosmosDB data is changed. The parameter type can be one of the following:
* </p>
*
* <ul>
@ -25,8 +24,8 @@ import java.lang.annotation.Target;
* </ul>
*
* <p>
* The following example shows a Java function that is invoked when there are
* inserts or updates in the specified database and collection.
* The following example shows a Java function that is invoked when there are inserts or updates in
* the specified database and collection.
* </p>
*
* <pre>
@ -37,7 +36,8 @@ import java.lang.annotation.Target;
* collectionName = "Items",
* leaseCollectionName = "leases",
* createLeaseCollectionIfNotExists = true,
* connectionStringSetting = "AzureCosmosDBConnection") List&lt;Map&lt;String, String&gt;&gt; items,
* connectionStringSetting = "AzureCosmosDBConnection")
* List&lt;Map&lt;String, String&gt;&gt; items,
* final ExecutionContext context
* ) {
* context.getLogger().info(items.size() + " item(s) is/are inserted.");
@ -52,168 +52,164 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PARAMETER })
public @interface CosmosDBTrigger {
/**
* The variable name used in function.json.
*
* @return The variable name used in function.json.
*/
String name();
/**
* The variable name used in function.json.
*
* @return The variable name used in function.json.
*/
String name();
/**
* <p>
* Defines how Functions runtime should treat the parameter value. Possible
* values are:
* </p>
* <ul>
* <li>"": get the value as a string, and try to deserialize to actual parameter
* type like POJO</li>
* <li>string: always get the value as a string</li>
* <li>binary: get the value as a binary data, and try to deserialize to actual
* parameter type byte[]</li>
* </ul>
*
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* <p>
* Defines how Functions runtime should treat the parameter value. Possible values are:
* </p>
* <ul>
* <li>"": get the value as a string, and try to deserialize to actual parameter type like
* POJO</li>
* <li>string: always get the value as a string</li>
* <li>binary: get the value as a binary data, and try to deserialize to actual parameter type
* byte[]</li>
* </ul>
*
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* Defines the database name of the CosmosDB to which to bind.
*
* @return The database name string.
*/
String databaseName();
/**
* Defines the database name of the CosmosDB to which to bind.
*
* @return The database name string.
*/
String databaseName();
/**
* Defines the collection name of the CosmosDB to which to bind.
*
* @return The collection name string.
*/
String collectionName();
/**
* Defines the collection name of the CosmosDB to which to bind.
*
* @return The collection name string.
*/
String collectionName();
/**
* Defines Connection string for the service containing the lease collection.
*
* @return Connection string for the lease collection.
*/
String leaseConnectionStringSetting() default "";
/**
* Defines Connection string for the service containing the lease collection.
*
* @return Connection string for the lease collection.
*/
String leaseConnectionStringSetting() default "";
/**
* Defines the lease collection name of the CosmosDB to which to bind.
*
* @return The lease collection name string.
*/
String leaseCollectionName() default "";
/**
* Defines the lease collection name of the CosmosDB to which to bind.
*
* @return The lease collection name string.
*/
String leaseCollectionName() default "";
/**
* Defines Name of the database containing the lease collection.
*
* @return Name of the database for lease collection.
*/
String leaseDatabaseName() default "";
/**
* Defines Name of the database containing the lease collection.
*
* @return Name of the database for lease collection.
*/
String leaseDatabaseName() default "";
/**
* Defines whether to create a new lease collection if not exists.
*
* @return configuration whether to create a new lease collection if not exists.
*/
boolean createLeaseCollectionIfNotExists() default false;
/**
* Defines whether to create a new lease collection if not exists.
*
* @return configuration whether to create a new lease collection if not exists.
*/
boolean createLeaseCollectionIfNotExists() default false;
/**
* defines the throughput of the created collection..
*
* @return throughput
*/
int leasesCollectionThroughput() default -1;
/**
* defines the throughput of the created collection..
*
* @return throughput
*/
int leasesCollectionThroughput() 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.
*
* @return LeaseCollectionPrefix
*/
String leaseCollectionPrefix() default "";
/**
* Defines a prefix to be used within a Leases collection for this Trigger. Useful when sharing
* the same Lease collection among multiple Triggers.
*
* @return LeaseCollectionPrefix
*/
String leaseCollectionPrefix() default "";
/**
* Customizes the amount of milliseconds between lease checkpoints. Default is
* always after a Function call.
*
* @return checkpointInterval
*/
int checkpointInterval() default -1;
/**
* Customizes the amount of milliseconds between lease checkpoints. Default is always after a
* Function call.
*
* @return checkpointInterval
*/
int checkpointInterval() default -1;
/**
* Customizes the amount of documents between lease checkpoints. Default is
* always after a Function call.
*
* @return CheckpointDocumentCount
*/
int checkpointDocumentCount() default -1;
/**
* Customizes the amount of documents between lease checkpoints. Default is always after a
* Function call.
*
* @return CheckpointDocumentCount
*/
int checkpointDocumentCount() default -1;
/**
* Customizes the delay in milliseconds in between polling a partition for new
* changes on the feed, after all current changes are drained. Default is 5000
* (5 seconds).
*
* @return feedPollDelay
*/
int feedPollDelay() default 5000;
/**
* Customizes the delay in milliseconds in between polling a partition for new changes on the
* feed, after all current changes are drained. Default is 5000 (5 seconds).
*
* @return feedPollDelay
*/
int feedPollDelay() default 5000;
/**
* Defines the app setting name that contains the CosmosDB connection string.
*
* @return The app setting name of the connection string.
*/
String connectionStringSetting();
/**
* Defines the app setting name that contains the CosmosDB connection string.
*
* @return The app setting name of the connection string.
*/
String connectionStringSetting();
/**
* Customizes the renew interval in milliseconds for all leases for partitions
* currently held by the Trigger. Default is 17000 (17 seconds).
*
* @return renew interval in milliseconds for all leases
*/
int leaseRenewInterval() default 17000;
/**
* Customizes the renew interval in milliseconds for all leases for partitions currently held by
* the Trigger. Default is 17000 (17 seconds).
*
* @return renew interval in milliseconds for all leases
*/
int leaseRenewInterval() default 17000;
/**
* Customizes the interval in milliseconds to kick off a task to compute if
* partitions are distributed evenly among known host instances. Default is
* 13000 (13 seconds).
*
* @return interval in milliseconds
*/
int leaseAcquireInterval() default 13000;
/**
* Customizes the interval in milliseconds to kick off a task to compute if partitions are
* distributed evenly among known host instances. Default is 13000 (13 seconds).
*
* @return interval in milliseconds
*/
int leaseAcquireInterval() default 13000;
/**
* Customizes the interval in milliseconds 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 Trigger instance. Default is 60000 (60 seconds).
*
* @return interval in milliseconds for which the lease is taken
*/
int leaseExpirationInterval() default 60000;
/**
* Customizes the interval in milliseconds 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 Trigger instance. Default is 60000 (60
* seconds).
*
* @return interval in milliseconds for which the lease is taken
*/
int leaseExpirationInterval() default 60000;
/**
* Customizes the maximum amount of items received in an invocation
*
* @return maximum amount of items received
*/
int maxItemsPerInvocation() default -1;
/**
* Customizes the maximum amount of items received in an invocation
*
* @return maximum amount of items received
*/
int maxItemsPerInvocation() default -1;
/**
* Gets or sets whether change feed in the Azure Cosmos DB service should start
* from beginning (true) or from current (false). By default it's start from
* current (false).
*
* @return Configuration whether change feed should start from beginning
*/
boolean startFromBeginning() default false;
/**
* Gets or sets whether change feed in the Azure Cosmos DB service should start from beginning
* (true) or from current (false). By default it's start from current (false).
*
* @return Configuration whether change feed should start from beginning
*/
boolean startFromBeginning() default false;
/**
* Defines preferred locations (regions) for geo-replicated database accounts in
* the Azure Cosmos DB service. Values should be comma-separated. example,
* PreferredLocations = "East US,South Central US,North Europe"
*
* @return preferred locations (regions) for geo-replicated database accounts
*/
String preferredLocations() default "";
/**
* Defines preferred locations (regions) for geo-replicated database accounts in the Azure Cosmos
* DB service. Values should be comma-separated. example, PreferredLocations = "East US,South
* Central US,North Europe"
*
* @return preferred locations (regions) for geo-replicated database accounts
*/
String preferredLocations() default "";
}

Просмотреть файл

@ -12,7 +12,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>Place this on a parameter whose value would come from EventGrid, and causing the method to run when an event is
* <p>
* Place this on a parameter whose value would come from EventGrid, and causing the method to run when an event is
* arrived. The parameter type can be one of the following:</p>
*
* <ul>

Просмотреть файл

@ -25,7 +25,9 @@ import java.lang.annotation.Target;
*
* <pre>{@literal @}FunctionName("eventHubMonitor")
* public void logEventHubMessage(
* {@literal @}EventHubTrigger(name = "event", eventHubName = "samples-workitems", connection = "AzureEventHubConnection") String message,
* {@literal @}EventHubTrigger(name = "event",
* eventHubName = "samples-workitems",
* connection = "AzureEventHubConnection") String message,
* final ExecutionContext context
* ) {
* context.getLogger().info("Event hub message received: " + message);
@ -60,7 +62,9 @@ public @interface EventHubTrigger {
String eventHubName();
/**
* Cardinality of the trigger input. Choose 'One' if the input is a single message or 'Many' if the input is an array of messages. 'Many' is the default if unspecified
* Cardinality of the trigger input.
* Choose 'One' if the input is a single message or 'Many' if the input is an array of messages.
* 'Many' is the default if unspecified
* @return An {@link Cardinality} value representing the Cardinality
*/
Cardinality cardinality() default Cardinality.MANY;

Просмотреть файл

@ -25,7 +25,8 @@ import java.lang.annotation.Target;
* {@literal @}FunctionName("redirect")
* public HttpResponseMessage&lt;String&gt; redirectFunction(
* {@literal @}HttpTrigger(name = "req",
* methods = {"get"}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage&lt;Optional&lt;String&gt;&gt; request) {
* methods = {"get"}, authLevel = AuthorizationLevel.ANONYMOUS)
* HttpRequestMessage&lt;Optional&lt;String&gt;&gt; request) {
* ....
* }</pre>
*

Просмотреть файл

@ -6,26 +6,30 @@
package com.microsoft.azure.functions.annotation;
import com.microsoft.azure.functions.HttpMethod;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.microsoft.azure.functions.HttpMethod;
/**
* <p>The HttpTrigger annotation is applied to Azure functions that will be triggered by a call to the HTTP endpoint that
* the function is located at. The HttpTrigger annotation should be applied to a method parameter of one of the following
* types:</p>
* <p>
* The HttpTrigger annotation is applied to Azure functions that will be triggered by a call to the
* HTTP endpoint that the function is located at. The HttpTrigger annotation should be applied to a
* method parameter of one of the following types:
* </p>
*
* <ul>
* <li>{@link com.microsoft.azure.functions.HttpRequestMessage HttpRequestMessage&lt;T&gt;}</li>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Nullable values using Optional&lt;T&gt;</li>
* <li>Any POJO type</li>
* <li>{@link com.microsoft.azure.functions.HttpRequestMessage HttpRequestMessage&lt;T&gt;}</li>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Nullable values using Optional&lt;T&gt;</li>
* <li>Any POJO type</li>
* </ul>
*
* <p>For example:</p>
* <p>
* For example:
* </p>
*
* <pre>
* {@literal @}FunctionName("hello")
@ -35,40 +39,51 @@ import com.microsoft.azure.functions.HttpMethod;
* authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage&lt;Optional&lt;String&gt;&gt; request
* ) {
* ....
* }</pre>
* }
* </pre>
*
* <p>In this code snippet you will observe that we have a function annotated with {@code @FunctionName("hello")},
* which indicates that this function will be available at the endpoint /api/hello. The name of the method itself, in
* this case {@code helloFunction} is irrelevant for all intents and purposes related to Azure Functions. Note however
* that the method return type is {@link com.microsoft.azure.functions.HttpResponseMessage}, and
* that the first argument into the function is an {@link com.microsoft.azure.functions.HttpRequestMessage}
* with generic type {@code Optional<String>}. This indicates that the body of the request will potentially contain
* a String value.</p>
* <p>
* In this code snippet you will observe that we have a function annotated with
* {@code @FunctionName("hello")}, which indicates that this function will be available at the
* endpoint /api/hello. The name of the method itself, in this case {@code helloFunction} is
* irrelevant for all intents and purposes related to Azure Functions. Note however that the method
* return type is {@link com.microsoft.azure.functions.HttpResponseMessage}, and that the first
* argument into the function is an {@link com.microsoft.azure.functions.HttpRequestMessage} with
* generic type {@code Optional<String>}. This indicates that the body of the request will
* potentially contain a String value.
* </p>
*
* <p>Most important of all however is the {@code @HttpTrigger} annotation that has been applied
* to this argument. In this annotation you'll note that it has been given a name, as well as told what type of requests
* it supports (in this case, only HTTP GET requests), and that the {@link AuthorizationLevel} is anonymous, allowing
* access to anyone who can call the endpoint.</p>
* <p>
* Most important of all however is the {@code @HttpTrigger} annotation that has been applied to
* this argument. In this annotation you'll note that it has been given a name, as well as told what
* type of requests it supports (in this case, only HTTP GET requests), and that the
* {@link AuthorizationLevel} is anonymous, allowing access to anyone who can call the endpoint.
* </p>
*
* <p>The {@code HttpTrigger} can be further customised by providing a custom {@link #route()}, which allows for custom
* endpoints to be specified, and for these endpoints to be parameterized with arguments being bound to arguments
* provided to the function at runtime.</p>
* <p>
* The {@code HttpTrigger} can be further customised by providing a custom {@link #route()}, which
* allows for custom endpoints to be specified, and for these endpoints to be parameterized with
* arguments being bound to arguments provided to the function at runtime.
* </p>
*
* <p>The following example shows a Java function that looks for a name parameter either in the query string (HTTP GET)
* or the body (HTTP POST) of the HTTP request. Notice that the return value is used for the output binding, but a return
* value attribute isn't required.</p>
* <p>
* The following example shows a Java function that looks for a name parameter either in the query
* string (HTTP GET) or the body (HTTP POST) of the HTTP request. Notice that the return value is
* used for the output binding, but a return value attribute isn't required.
* </p>
*
* <pre>
* {@literal @}FunctionName("readHttpName")
* public String readName(
* {@literal @}HttpTrigger(name = "req", methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS)
* final HttpRequestMessage&lt;Optional&lt;String&gt;&gt; request
* ) {
* {@literal @}HttpTrigger(name = "req",
* methods = {HttpMethod.GET, HttpMethod.POST}, authLevel = AuthorizationLevel.ANONYMOUS)
* final HttpRequestMessage&lt;Optional&lt;String&gt;&gt; request) {
* String name = request.getBody().orElseGet(() -&gt; request.getQueryParameters().get("name"));
* return name == null ?
* "Please pass a name on the query string or in the request body" :
* "Hello " + name;
* }</pre>
* }
* </pre>
*
* @see com.microsoft.azure.functions.HttpRequestMessage
* @see com.microsoft.azure.functions.HttpResponseMessage
@ -77,84 +92,106 @@ import com.microsoft.azure.functions.HttpMethod;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface HttpTrigger {
/**
* The variable name used in function code for the request or request body.
* @return The variable name used in function code for the request or request body.
*/
String name();
/**
* The variable name used in function code for the request or request body.
*
* @return The variable name used in function code for the request or request body.
*/
String name();
/**
* <p>Defines how Functions runtime should treat the parameter value. Possible values are:</p>
* <ul>
* <li>"": get the value as a string, and try to deserialize to actual parameter type like POJO</li>
* <li>string: always get the value as a string</li>
* <li>binary: get the value as a binary data, and try to deserialize to actual parameter type byte[]</li>
* </ul>
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* <p>
* Defines how Functions runtime should treat the parameter value. Possible values are:
* </p>
* <ul>
* <li>"": get the value as a string, and try to deserialize to actual parameter type like
* POJO</li>
* <li>string: always get the value as a string</li>
* <li>binary: get the value as a binary data, and try to deserialize to actual parameter type
* byte[]</li>
* </ul>
*
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* <p>Defines the route template, controlling which request URLs your function will respond to. The default value if
* no route is provided is the function name specified in the {@link FunctionName} annotation, applied to each
* Azure Function.</p>
*
* <p>By default when you create a function for an HTTP trigger, or WebHook, the function is addressable with a
* route of the form {@code http://&lt;yourapp&gt;.azurewebsites.net/api/&lt;funcname&gt;}. You can customize this route using
* this route property. For example, a route of {@code "products/{category:alpha}/{id:int}"} would mean that the
* function is now addressable with the following route instead of the original route:
* {@code http://&lt;yourapp&gt;.azurewebsites.net/api/products/electronics/357}, which allows the function code to support
* two parameters in the address: category and id. By specifying the route in this way, developers can then
* add the additional route arguments as arguments into the function by using the {@link BindingName} annotation.
* For example:</p>
*
* <pre>
* {@literal @}FunctionName("routeTest")
* public HttpResponseMessage&lt;String&gt; routeTest(
* {@literal @}HttpTrigger(name = "req",
* methods = {HttpMethod.GET},
* authLevel = AuthorizationLevel.ANONYMOUS,
* route = "products/{category:alpha}/{id:int}") HttpRequestMessage&lt;Optional&lt;String&gt;&gt; request,
* {@literal @}BindingName("category") String category,
* {@literal @}BindingName("id") int id,
* final ExecutionContext context
* ) {
* ....
* context.getLogger().info("We have " + category + " with id " + id);
* ....
* }
* </pre>
*
* <p>For more details on the route syntax, refer to the
* <a href="https://docs.microsoft.com/en-us/aspnet/web-api/overview/web-api-routing-and-actions/attribute-routing-in-web-api-2#constraints">
* online documentation</a>.</p>
*
* @return The route template to use for the annotated function.
*/
String route() default "";
/**
* <p>
* Defines the route template, controlling which request URLs your function will respond to. The
* default value if no route is provided is the function name specified in the
* {@link FunctionName} annotation, applied to each Azure Function.
* </p>
*
* <p>
* By default when you create a function for an HTTP trigger, or WebHook, the function is
* addressable with a route of the form
* {@code http://&lt;yourapp&gt;.azurewebsites.net/api/&lt;funcname&gt;}. You can customize this
* route using this route property. For example, a route of
* {@code "products/{category:alpha}/{id:int}"} would mean that the function is now addressable
* with the following route instead of the original route:
* {@code http://&lt;yourapp&gt;.azurewebsites.net/api/products/electronics/357}, which allows the
* function code to support two parameters in the address: category and id. By specifying the
* route in this way, developers can then add the additional route arguments as arguments into the
* function by using the {@link BindingName} annotation. For example:
* </p>
*
* <pre>
* {@literal @}FunctionName("routeTest")
* public HttpResponseMessage&lt;String&gt; routeTest(
* {@literal @}HttpTrigger(name = "req",
* methods = {HttpMethod.GET},
* authLevel = AuthorizationLevel.ANONYMOUS,
* route = "products/{category:alpha}/{id:int}")
* HttpRequestMessage&lt;Optional&lt;String&gt;&gt; request,
* {@literal @}BindingName("category") String category,
* {@literal @}BindingName("id") int id,
* final ExecutionContext context
* ) {
* ....
* context.getLogger().info("We have " + category + " with id " + id);
* ....
* }
* </pre>
*
* <p>
* For more details on the route syntax, refer to the <a href=
* "https://docs.microsoft.com/en-us/aspnet/web-api/overview/web-api-routing-and-actions">
* online documentation</a>.
* </p>
*
* @return The route template to use for the annotated function.
*/
String route() default "";
/**
* An array of the HTTP methods to which the function responds. If not specified, the function responds to all HTTP
* methods.
*
* @return An array containing all valid HTTP methods.
*/
HttpMethod[] methods() default {};
/**
* An array of the HTTP methods to which the function responds. If not specified, the function
* responds to all HTTP methods.
*
* @return An array containing all valid HTTP methods.
*/
HttpMethod[] methods() default {};
/**
* <p>Determines what keys, if any, need to be present on the request in order to invoke the function. The authorization
* level can be one of the following values:</p>
*
* <ul>
* <li><strong>anonymous</strong>: No API key is required.</li>
* <li><strong>function</strong>: A function-specific API key is required. This is the default value if none is provided.</li>
* <li><strong>admin</strong>: The master key is required.</li>
* </ul>
*
* <p>For more information, see the
* <a href="https://docs.microsoft.com/azure/azure-functions/functions-bindings-http-webhook#authorization-keys">documentation about authorization keys</a>.</p>
*
* @return An {@link AuthorizationLevel} value representing the level required to access the function.
*/
AuthorizationLevel authLevel() default AuthorizationLevel.FUNCTION;
/**
* <p>
* Determines what keys, if any, need to be present on the request in order to invoke the
* function. The authorization level can be one of the following values:
* </p>
*
* <ul>
* <li><strong>anonymous</strong>: No API key is required.</li>
* <li><strong>function</strong>: A function-specific API key is required. This is the default
* value if none is provided.</li>
* <li><strong>admin</strong>: The master key is required.</li>
* </ul>
*
* <p>
* For more information, see the <a href=
* "https://docs.microsoft.com/azure/azure-functions/functions-bindings-http-webhook#authorization-keys">documentation
* about authorization keys</a>.
* </p>
*
* @return An {@link AuthorizationLevel} value representing the level required to access the
* function.
*/
AuthorizationLevel authLevel() default AuthorizationLevel.FUNCTION;
}

Просмотреть файл

@ -1,70 +0,0 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>Place this on a parameter whose value would come from mobile table.
* The parameter type can be one of the following:</p>
*
* <ul>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Nullable values using Optional&lt;T&gt;</li>
* <li>Any POJO type</li>
* </ul>
*
*
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface MobileTableInput {
/**
* The variable name used in function.json.
* @return The variable name used in function.json.
*/
String name();
/**
* <p>Defines how Functions runtime should treat the parameter value. Possible values are:</p>
* <ul>
* <li>"": get the value as a string, and try to deserialize to actual parameter type like POJO</li>
* <li>string: always get the value as a string</li>
* <li>binary: get the value as a binary data, and try to deserialize to actual parameter type byte[]</li>
* </ul>
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* Defines the name of the mobile table.
* @return The mobile table name string.
*/
String tableName();
/**
* Defines the ID of the mobile table.
* @return The mobile table ID string.
*/
String id();
/**
* Defines the app setting name that contains the mobile table connection string.
* @return The app setting name of the connection string.
*/
String connection();
/**
* Defines the API key of the mobile table.
* @return The mobile table API key string.
*/
String apiKey();
}

Просмотреть файл

@ -1,62 +0,0 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>Place this on a parameter whose value would be written to mobile table.
* The parameter type should be OutputBinding&lt;T&gt;, where T could be one of:</p>
*
* <ul>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Any POJO type</li>
* </ul>
*
*
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER, ElementType.METHOD})
public @interface MobileTableOutput {
/**
* The variable name used in function.json.
* @return The variable name used in function.json.
*/
String name();
/**
* <p>Defines how Functions runtime should treat the parameter value. Possible values are:</p>
* <ul>
* <li>"" or string: treat it as a string whose value is serialized from the parameter</li>
* <li>binary: treat it as a binary data whose value comes from for example OutputBinding&lt;byte[]&gt;</li>
* </ul>
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* Defines the name of the mobile table to which to write.
* @return The mobile table name string.
*/
String tableName();
/**
* Defines the app setting name that contains the mobile table connection string.
* @return The app setting name of the connection string.
*/
String connection();
/**
* Defines the API key of the mobile table to which to write.
* @return The mobile table API key string.
*/
String apiKey();
}

Просмотреть файл

@ -26,7 +26,8 @@ import java.lang.annotation.Target;
*
* <pre>{@literal @}FunctionName("queueMonitor")
* public void logQueueItem(
* {@literal @}QueueTrigger(name = "msg", queueName = "myqueue-items", connection = "AzureWebJobsStorage") String message,
* {@literal @}QueueTrigger(name = "msg", queueName = "myqueue-items", connection = "AzureWebJobsStorage")
* String message,
* final ExecutionContext context
* ) {
* context.getLogger().info("Queue message processed: " + message);

Просмотреть файл

@ -12,62 +12,78 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>Place this on a parameter whose value would come from a Service Bus queue, and causing the method to run when a
* new item is pushed. The parameter type can be one of the following:</p>
* <p>
* Place this on a parameter whose value would come from a Service Bus queue, and causing the method
* to run when a new item is pushed. The parameter type can be one of the following:
* </p>
*
* <ul>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Nullable values using Optional&lt;T&gt;</li>
* <li>Any POJO type</li>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Nullable values using Optional&lt;T&gt;</li>
* <li>Any POJO type</li>
* </ul>
*
* <p>The following example shows a Java function that logs a Service Bus queue message:</p>
* <p>
* The following example shows a Java function that logs a Service Bus queue message:
* </p>
*
* <pre>{@literal @}FunctionName("serviceBusMonitor")
* <pre>
* {@literal @}FunctionName("serviceBusMonitor")
* public void logServiceBusMessage(
* {@literal @}ServiceBusQueueTrigger(name = "msg", queueName = "myqueue", connection = "AzureServiceBusConnection") final String message,
* {@literal @}ServiceBusQueueTrigger(name = "msg", queueName = "myqueue", connection = "AzureServiceBusConnection")
* final String message,
* final ExecutionContext context
* ) {
* context.getLogger().info("Message is received: " + message);
* }</pre>
* }
* </pre>
*
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface ServiceBusQueueTrigger {
/**
* The variable name used in function.json.
* @return The variable name used in function.json.
*/
String name();
/**
* The variable name used in function.json.
*
* @return The variable name used in function.json.
*/
String name();
/**
* <p>Defines how Functions runtime should treat the parameter value. Possible values are:</p>
* <ul>
* <li>"": get the value as a string, and try to deserialize to actual parameter type like POJO</li>
* <li>string: always get the value as a string</li>
* <li>binary: get the value as a binary data, and try to deserialize to actual parameter type byte[]</li>
* </ul>
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* <p>
* Defines how Functions runtime should treat the parameter value. Possible values are:
* </p>
* <ul>
* <li>"": get the value as a string, and try to deserialize to actual parameter type like
* POJO</li>
* <li>string: always get the value as a string</li>
* <li>binary: get the value as a binary data, and try to deserialize to actual parameter type
* byte[]</li>
* </ul>
*
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* Defines the name of the Service Bus queue to which to bind.
* @return The Service Bus queue string.
*/
String queueName();
/**
* Defines the name of the Service Bus queue to which to bind.
*
* @return The Service Bus queue string.
*/
String queueName();
/**
* Defines the app setting name that contains the Service Bus connection string.
* @return The app setting name of the connection string.
*/
String connection();
/**
* Defines the app setting name that contains the Service Bus connection string.
*
* @return The app setting name of the connection string.
*/
String connection();
/**
* Defines the permission of the Service Bus queue to which to bind.
* @return The Service Bus queue permission.
*/
AccessRights access() default AccessRights.MANAGE;
/**
* Defines the permission of the Service Bus queue to which to bind.
*
* @return The Service Bus queue permission.
*/
AccessRights access() default AccessRights.MANAGE;
}

Просмотреть файл

@ -12,57 +12,68 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>Place this on a parameter whose value would be written to a service bus topic.
* The parameter type should be OutputBinding&lt;T&gt;, where T could be one of:</p>
* <p>
* Place this on a parameter whose value would be written to a service bus topic. The parameter type
* should be OutputBinding&lt;T&gt;, where T could be one of:
* </p>
*
* <ul>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Any POJO type</li>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Any POJO type</li>
* </ul>
*
*
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER, ElementType.METHOD})
@Target({ ElementType.PARAMETER, ElementType.METHOD })
public @interface ServiceBusTopicOutput {
/**
* The variable name used in function.json.
* @return The variable name used in function.json.
*/
String name();
/**
* The variable name used in function.json.
*
* @return The variable name used in function.json.
*/
String name();
/**
* <p>Defines how Functions runtime should treat the parameter value. Possible values are:</p>
* <ul>
* <li>"" or string: treat it as a string whose value is serialized from the parameter</li>
* <li>binary: treat it as a binary data whose value comes from for example OutputBinding&lt;byte[]&gt;</li>
* </ul>
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* <p>
* Defines how Functions runtime should treat the parameter value. Possible values are:
* </p>
* <ul>
* <li>"" or string: treat it as a string whose value is serialized from the parameter</li>
* <li>binary: treat it as a binary data whose value comes from for example
* OutputBinding&lt;byte[]&gt;</li>
* </ul>
*
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* Defines the name of the Service Bus topic to which to write.
* @return The Service Bus topic name string.
*/
String topicName();
/**
* Defines the name of the Service Bus topic to which to write.
*
* @return The Service Bus topic name string.
*/
String topicName();
/**
* Defines the subscription name of the Service Bus topic to which to write.
* @return The Service Bus topic subscription name string.
*/
String subscriptionName();
/**
* Defines the subscription name of the Service Bus topic to which to write.
*
* @return The Service Bus topic subscription name string.
*/
String subscriptionName();
/**
* Defines the app setting name that contains the Service Bus connection string.
* @return The app setting name of the connection string.
*/
String connection();
/**
* Defines the app setting name that contains the Service Bus connection string.
*
* @return The app setting name of the connection string.
*/
String connection();
/**
* Defines the permission of the Service Bus topic to which to write.
* @return The Service Bus topic permission.
*/
AccessRights access() default AccessRights.MANAGE;
/**
* Defines the permission of the Service Bus topic to which to write.
*
* @return The Service Bus topic permission.
*/
AccessRights access() default AccessRights.MANAGE;
}

Просмотреть файл

@ -12,18 +12,23 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* <p>Place this on a parameter whose value would come from Service Bus topic, and causing the method to run when a new
* item is published. The parameter type can be one of the following:</p>
* <p>
* Place this on a parameter whose value would come from Service Bus topic, and causing the method
* to run when a new item is published. The parameter type can be one of the following:
* </p>
*
* <ul>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Nullable values using Optional&lt;T&gt;</li>
* <li>Any POJO type</li>
* <li>Any native Java types such as int, String, byte[]</li>
* <li>Nullable values using Optional&lt;T&gt;</li>
* <li>Any POJO type</li>
* </ul>
*
* <p>The following example shows a service bus topic trigger which logs the message:</p>
* <p>
* The following example shows a service bus topic trigger which logs the message:
* </p>
*
* <pre>{@literal @}FunctionName("sbprocessor")
* <pre>
* {@literal @}FunctionName("sbprocessor")
* public void serviceBusProcess(
* {@literal @}ServiceBusTopicTrigger(name = "msg",
* topicName = "mytopicname",
@ -32,51 +37,62 @@ import java.lang.annotation.Target;
* final ExecutionContext context
* ) {
* context.getLogger().info(message);
* }</pre>
* }
* </pre>
*
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface ServiceBusTopicTrigger {
/**
* The variable name used in function.json.
* @return The variable name used in function.json.
*/
String name();
/**
* The variable name used in function.json.
*
* @return The variable name used in function.json.
*/
String name();
/**
* <p>Defines how Functions runtime should treat the parameter value. Possible values are:</p>
* <ul>
* <li>"": get the value as a string, and try to deserialize to actual parameter type like POJO</li>
* <li>string: always get the value as a string</li>
* <li>binary: get the value as a binary data, and try to deserialize to actual parameter type byte[]</li>
* </ul>
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* <p>
* Defines how Functions runtime should treat the parameter value. Possible values are:
* </p>
* <ul>
* <li>"": get the value as a string, and try to deserialize to actual parameter type like
* POJO</li>
* <li>string: always get the value as a string</li>
* <li>binary: get the value as a binary data, and try to deserialize to actual parameter type
* byte[]</li>
* </ul>
*
* @return The dataType which will be used by the Functions runtime.
*/
String dataType() default "";
/**
* Defines the name of the Service Bus topic to which to bind.
* @return The Service Bus topic name string.
*/
String topicName();
/**
* Defines the name of the Service Bus topic to which to bind.
*
* @return The Service Bus topic name string.
*/
String topicName();
/**
* Defines the subscription name of the Service Bus topic to which to bind.
* @return The Service Bus topic subscription name string.
*/
String subscriptionName();
/**
* Defines the subscription name of the Service Bus topic to which to bind.
*
* @return The Service Bus topic subscription name string.
*/
String subscriptionName();
/**
* Defines the app setting name that contains the Service Bus connection string.
* @return The app setting name of the connection string.
*/
String connection();
/**
* Defines the app setting name that contains the Service Bus connection string.
*
* @return The app setting name of the connection string.
*/
String connection();
/**
* Defines the permission of the Service Bus topic to which to bind.
* @return The Service Bus topic permission.
*/
AccessRights access() default AccessRights.MANAGE;
/**
* Defines the permission of the Service Bus topic to which to bind.
*
* @return The Service Bus topic permission.
*/
AccessRights access() default AccessRights.MANAGE;
}

Просмотреть файл

@ -1,4 +1,11 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
/**
* Annotations and support classes for use as part of the Java API for Azure Functions.
*/
package com.microsoft.azure.functions.annotation;
package com.microsoft.azure.functions.annotation;

Просмотреть файл

@ -1,4 +1,11 @@
/**
* The root package for the Java API for Azure Functions.
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*/
package com.microsoft.azure.functions;
/**
* Root package
*/
package com.microsoft.azure.functions;

Просмотреть файл

@ -1,8 +1,6 @@
set libraryVersion=%1
echo %libraryVersion%
set pluginVersion=%2
echo %pluginVersion%
call mvn versions:set-property -Dproperty=azure.functions.java.library.version -DnewVersion=%libraryVersion%
call mvn versions:set-property -Dproperty=azure.functions.maven.plugin.version -DnewVersion=%pluginVersion%
echo setting azure.functions.java.library.version to %libraryVersion%
echo settong azure.functions.maven.plugin.version to %pluginVersion%
call mvn versions:set-property -Dproperty=azure.functions.java.library.version -DnewVersion=%libraryVersion% -U -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B
call mvn versions:set-property -Dproperty=azure.functions.maven.plugin.version -DnewVersion=%pluginVersion% -U -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B