-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathFunctionName.java
More file actions
43 lines (40 loc) · 1.59 KB
/
FunctionName.java
File metadata and controls
43 lines (40 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* 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>The {@code FunctionName} annotation is used to specify to the Azure Functions tooling what name is to be applied
* to the associated function when the function is deployed onto Azure. This becomes the endpoint (in the case of an
* {@link HttpTrigger http triggered} function, for example, but more generally it is what is shown to users in the
* Azure Portal, so a succinct and understandable function name is useful.</p>
*
* <p>An example of how the {@code FunctionName} annotation is shown in the code snippet below. Note that it is applied
* to the function that will be called by Azure, based on the specified trigger (in the code below it is a
* {@link HttpTrigger}).</p>
*
* <pre>
* {@literal @}FunctionName("redirect")
* public HttpResponseMessage<String> redirectFunction(
* {@literal @}HttpTrigger(name = "req",
* methods = {"get"}, authLevel = AuthorizationLevel.ANONYMOUS)
* HttpRequestMessage<Optional<String>> request) {
* ....
* }</pre>
*
* @since 1.0.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface FunctionName {
/**
* The name of the function.
* @return The name of the function.
*/
String value();
}