Skip to content

Commit af8c2ae

Browse files
committed
Increase score
1 parent 8627be9 commit af8c2ae

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

articles/azure-functions/functions-reference-java.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A function should be a stateless method to process input and produce output. Alt
2525

2626
## Folder structure
2727

28-
The folder structure for a Java project looks like the following:
28+
Here is the folder structure of an Azure Function Java project:
2929

3030
```
3131
FunctionsProject
@@ -57,7 +57,7 @@ You can put more than one function in a project. Avoid putting your functions in
5757

5858
Azure functions are invoked by a trigger, such as an HTTP request, a timer, or an update to data. Your function needs to process that trigger and any other inputs to produce one or more outputs.
5959

60-
Use the Java annotations included in the [com.microsoft.azure.functions.annotation.*](/java/api/com.microsoft.azure.functions.annotation) package to bind input and outputs to your methods. Sample code using the annotations is available in the [Java reference docs](/java/api/com.microsoft.azure.functions.annotation) for each annotation and in the Azure Functions binding reference documentation, such as the one for [HTTP triggers](/azure/azure-functions/functions-bindings-http-webhook).
60+
Use the Java annotations included in the [com.microsoft.azure.functions.annotation.*](/java/api/com.microsoft.azure.functions.annotation) package to bind input and outputs to your methods. See [Java reference docs](/java/api/com.microsoft.azure.functions.annotation) for more details.
6161

6262
> [!IMPORTANT]
6363
> You must configure an Azure Storage account in your [local.settings.json](/azure/azure-functions/functions-run-local#local-settings-file) to run Azure Storage Blob, Queue, or Table triggers locally.
@@ -100,17 +100,17 @@ here is the generated corresponding `function.json` by the [azure-functions-mave
100100

101101
## JDK runtime availability and support
102102

103-
Download and use the [Azul Zulu for Azure](https://assets.azul.com/files/Zulu-for-Azure-FAQ.pdf) JDKs from [Azul Systems](https://www.azul.com/downloads/azure-only/zulu/) for local development of Java function apps. JDKs are available for Windows, Linux, and macOS and [Azure support](https://support.microsoft.com/en-us/help/4026305/sql-contact-microsoft-azure-support) is available for issues encountered during development with a [qualified support plan](https://azure.microsoft.com/support/plans/).
103+
Download and use the [Azul Zulu for Azure](https://assets.azul.com/files/Zulu-for-Azure-FAQ.pdf) JDKs from [Azul Systems](https://www.azul.com/downloads/azure-only/zulu/) for local development of Java function apps. JDKs are available for Windows, Linux, and macOS. [Azure support](https://support.microsoft.com/en-us/help/4026305/sql-contact-microsoft-azure-support) is available with a [qualified support plan](https://azure.microsoft.com/support/plans/).
104104

105105
## Third-party libraries
106106

107107
Azure Functions supports the use of third-party libraries. By default, all dependencies specified in your project `pom.xml` file will be automatically bundled during the [`mvn package`](https://github.com/Microsoft/azure-maven-plugins/blob/master/azure-functions-maven-plugin/README.md#azure-functionspackage) goal. For libraries not specified as dependencies in the `pom.xml` file, place them in a `lib` directory in the function's root directory. Dependencies placed in the `lib` directory will be added to the system class loader at runtime.
108108

109-
The `com.microsoft.azure.functions:azure-functions-java-library` dependency is provided on the classpath by default, and does not need to be included in the `lib` directory. Also, depedencies listed [here](https://github.com/Azure/azure-functions-java-worker/wiki/Azure-Java-Functions-Worker-Dependencies) are added to the classpath by [azure-functions-java-worker](https://github.com/Azure/azure-functions-java-worker).
109+
The `com.microsoft.azure.functions:azure-functions-java-library` dependency is provided on the classpath by default, and does not need to be included in the `lib` directory. Also, dependencies listed [here](https://github.com/Azure/azure-functions-java-worker/wiki/Azure-Java-Functions-Worker-Dependencies) are added to the classpath by [azure-functions-java-worker](https://github.com/Azure/azure-functions-java-worker).
110110

111111
## Data type support
112112

113-
You can use Plain old Java objects (POJOs), primitive dataTypes such as String, Ineteger or types defined in `azure-functions-java-library` package for input and output bindings. The Azure Functions runtime attempts convert the input received into the type requested by your code.
113+
You can use Plain old Java objects (POJOs), types defined in `azure-functions-java-library` or primitive dataTypes such as String, Integer to bind to input/output bindings. The Azure Functions runtime attempts convert the input received into the type requested by your code.
114114

115115
### Plain old Java objects (POJOs)
116116

@@ -187,7 +187,7 @@ public class Function {
187187
}
188188
```
189189

190-
This function is invoked with a HTTP request. HTTP request payload is passed as a `String` for the argument `inputReq`; and one entry is retrieved from the Azure Table Storage and is passed as `TestInputData` to the argument `inputData`.
190+
This function is invoked with an HTTP request. HTTP request payload is passed as a `String` for the argument `inputReq`; and one entry is retrieved from the Azure Table Storage and is passed as `TestInputData` to the argument `inputData`.
191191

192192
To receive a batch of inputs bind to `String[]`, `POJO[]`, `List<String>` or `List<POJO>`
193193

@@ -206,7 +206,7 @@ To receive a batch of inputs bind to `String[]`, `POJO[]`, `List<String>` or `Li
206206

207207
```
208208

209-
This function gets triggered whenever there is new data in the configured eventhub. As the `cardinality` is set to `MANY`, function receives a batch of messages from event hub. EventData from eventhub gets converted to `TestEventData` for the function execution.
209+
This function gets triggered whenever there is new data in the configured event hub. As the `cardinality` is set to `MANY`, function receives a batch of messages from event hub. EventData from event hub gets converted to `TestEventData` for the function execution.
210210

211211
### Example Output binding
212212

@@ -263,7 +263,7 @@ To send multiple output values, use `OutputBinding<T>` defined in the `azure-fun
263263
}
264264
```
265265

266-
Above function is invoked on a HttpRequest and writes multiple values to the Azure Queue
266+
Above function is invoked on an HttpRequest and writes multiple values to the Azure Queue
267267

268268
## HttpRequestMessage and HttpResponseMessage
269269

@@ -317,7 +317,11 @@ In the example above, the `queryValue` is bound to query string parameter `name`
317317
318318
## Execution context
319319

320-
`ExecutionContext` type defined in the `azure-functions-java-library` package contains Logger that can be used to write logs from function code and helper method to get the function invocation id
320+
`ExecutionContext` defined in the `azure-functions-java-library` contains helper methods to communicate with the functions runtime.
321+
322+
### Logger
323+
324+
Use `getLogger` defined in `ExecutionContext` to write logs from function code.
321325

322326
Example:
323327

@@ -338,7 +342,9 @@ public class Function {
338342

339343
## View logs and trace
340344

341-
You can use the Azure CLI to stream Java standard out and error logging as well as other application logging. First, Configure your Function application to write application logging using the Azure CLI:
345+
You can use the Azure CLI to stream Java standard out and error logging as well as other application logging.
346+
347+
Configure your Function application to write application logging using the Azure CLI:
342348

343349
```azurecli-interactive
344350
az webapp log config --name functionname --resource-group myResourceGroup --application-logging true
@@ -361,7 +367,7 @@ You must have enabled file system logging in the Azure Portal or Azure CLI befor
361367

362368
## Environment variables
363369

364-
In Functions, [app settings](https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings), such as service connection strings, are exposed as environment variables during execution. You can access these settings using , `System.getenv("AzureWebJobsStorage")`
370+
In Functions, [app settings](https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings), such as service connection strings, are exposed as environment variables during execution. You can access these settings using, `System.getenv("AzureWebJobsStorage")`
365371

366372
Example:
367373

0 commit comments

Comments
 (0)