You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-create-first-java-maven.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -226,3 +226,6 @@ You have created a Java function app with a simple HTTP trigger and deployed it
226
226
- Add additional functions with different triggers to your project using the `azure-functions:add` Maven target.
227
227
- Write and debug functions locally with [Visual Studio Code](https://code.visualstudio.com/docs/java/java-azurefunctions), [IntelliJ](functions-create-maven-intellij.md), and [Eclipse](functions-create-maven-eclipse.md).
228
228
- Debug functions deployed in Azure with Visual Studio Code. See the Visual Studio Code [serverless Java applications](https://code.visualstudio.com/docs/java/java-serverless#_remote-debug-functions-running-in-the-cloud) documentation for instructions.
229
+
230
+
> [!NOTE]
231
+
> You can also create a Kotlin-based Azure Functions project by using the azure-functions-kotlin-archetype instead. Visit the [GitHub repository](https://github.com/microsoft/azure-maven-archetypes/tree/develop/azure-functions-kotlin-archetype) for more information.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-reference-java.md
+31-1Lines changed: 31 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,14 +19,42 @@ ms.author: routlaw
19
19
20
20
The Azure Functions runtime supports [Java SE 8 LTS (zulu8.31.0.2-jre8.0.181-win_x64)](https://repos.azul.com/azure-only/zulu/packages/zulu-8/8u181/). This guide contains information about the intricacies of writing Azure Functions with Java.
21
21
22
-
A Java function is a `public` method, decorated with the annotation `@FunctionName`. This method defines the entry for a Java function, and must be unique in a particular package.
22
+
As it happens to other languages, a Function App may have one or more functions. A Java function is a `public` method, decorated with the annotation `@FunctionName`. This method defines the entry for a Java function, and must be unique in a particular package. One Function App written in Java may have multiple classes with multiple public methods annotated with `@FunctionName`.
23
23
24
24
This article assumes that you have already read the [Azure Functions developer reference](functions-reference.md). You should also complete the Functions quickstart to create your first function, by using [Visual Studio Code](functions-create-first-function-vs-code.md) or [Maven](functions-create-first-java-maven.md).
25
25
26
26
## Programming model
27
27
28
28
The concepts of [triggers and bindings](functions-triggers-bindings.md) are fundamental to Azure Functions. Triggers start the execution of your code. Bindings give you a way to pass data to and return data from a function, without having to write custom data access code.
29
29
30
+
## Project Scaffolding
31
+
32
+
The simplest way to scaffold a Java-based Azure Function project is to use `Apache Maven` archetypes. You can also find project generation wizards on Visual Studio Code, and the Azure Toolkits for Eclipse and IntelliJ.
33
+
34
+
There are currently two Azure Functions archetypes for Maven:
35
+
36
+
### Java Archetype
37
+
38
+
This archetype is published under the following groupId and artifactId [com.microsoft.azure:azure-functions-archetype](https://search.maven.org/artifact/com.microsoft.azure/azure-functions-archetype/).
39
+
40
+
```
41
+
mvn archetype:generate \
42
+
-DarchetypeGroupId=com.microsoft.azure \
43
+
-DarchetypeArtifactId=azure-functions-archetype
44
+
```
45
+
46
+
### Kotlin Archetype (Preview)
47
+
48
+
This archetype is published under the following groupId and artifactId [com.microsoft.azure:azure-functions-kotlin-archetype](https://search.maven.org/artifact/com.microsoft.azure/azure-functions-kotlin-archetype/).
The source code of these archetypes can be found on the [Azure Maven Archetypes GitHub repository](https://github.com/microsoft/azure-maven-archetypes).
57
+
30
58
## Folder structure
31
59
32
60
Here is the folder structure of an Azure Functions Java project:
@@ -53,6 +81,8 @@ FunctionsProject
53
81
| - pom.xml
54
82
```
55
83
84
+
_* The Kotlin project looks very similar since it is still Maven_
85
+
56
86
You can use a shared [host.json](functions-host-json.md) file to configure the function app. Each function has its own code file (.java) and binding configuration file (function.json).
57
87
58
88
You can put more than one function in a project. Avoid putting your functions into separate jars. The `FunctionApp` in the target directory is what gets deployed to your function app in Azure.
0 commit comments