From 12d0858e9b513fe03f5ac6e79bcb46217d00b59b Mon Sep 17 00:00:00 2001 From: Julien Dubois Date: Wed, 6 Dec 2023 11:24:08 +0100 Subject: [PATCH 1/2] Review and fix getting-started-with-spring-cloud-function-in-azure --- ...ted-with-spring-cloud-function-in-azure.md | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/articles/java/spring-framework/getting-started-with-spring-cloud-function-in-azure.md b/articles/java/spring-framework/getting-started-with-spring-cloud-function-in-azure.md index 6ece2df3c4..63bea5e2ea 100644 --- a/articles/java/spring-framework/getting-started-with-spring-cloud-function-in-azure.md +++ b/articles/java/spring-framework/getting-started-with-spring-cloud-function-in-azure.md @@ -5,7 +5,7 @@ documentationcenter: java manager: brborges author: KarlErickson ms.author: judubois -ms.date: 09/07/2021 +ms.date: 05/12/2023 ms.service: azure-functions ms.tgt_pltfrm: multiple ms.topic: article @@ -30,7 +30,7 @@ To develop functions using Java, you must have the following installed: > [!IMPORTANT] > 1. You must set the `JAVA_HOME` environment variable to the install location of the JDK to complete this quickstart. -> 2. Make sure your core tools version is at least 4.0.5030. +> 2. Make sure your core tools version is at least 4.0.5455. ## What we're going to build @@ -60,20 +60,18 @@ Change those properties directly near the top of the *pom.xml* file, as shown in ```xml - UTF-8 - 11 - 11 + 11 - 1.22.0 - 3.0.0 + + com.example.DemoApplication - + + 1.29.0 my-spring-function-resource-group my-spring-function-service-plan my-spring-function - - westeurope - example.Application + Y1 + eastus ``` @@ -176,33 +174,32 @@ This application manages all business logic, and has access to the full Spring B - It doesn't rely on the Azure Functions APIs, so you can easily port it to other systems. For example, you can reuse it in a normal Spring Boot application. - You can use all the `@Enable` annotations from Spring Boot to add new features. -In the *src/main/java/example* folder, create the following file, which is a normal Spring Boot application: +In the *src/main/java/com/example* folder, create the following file, which is a normal Spring Boot application: *DemoApplication.java*: ```java -package example; +package com.example; -import example.uppercase.Config; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class Application { +public class DemoApplication { public static void main(String[] args) throws Exception { - SpringApplication.run(Config.class, args); + SpringApplication.run(DemoApplication.class, args); } } ``` -Now create the following file in the *src/main/java/example/hello* folder. This code contains a Spring Boot component that represents the Function we want to run: +Now create the following file in the *src/main/java/com/example/hello* folder. This code contains a Spring Boot component that represents the Function we want to run: *Hello.java*: ```java -package example.hello; +package com.example.hello; -import example.hello.model.*; +import com.example.model.*; import org.springframework.stereotype.Component; import java.util.function.Function; @@ -231,13 +228,13 @@ In the *src/main/java/com/example/hello* folder, create the following Azure Func *HelloHandler.java*: ```java -package example.hello; +package com.example.hello; import com.microsoft.azure.functions.*; import com.microsoft.azure.functions.annotation.AuthorizationLevel; import com.microsoft.azure.functions.annotation.FunctionName; import com.microsoft.azure.functions.annotation.HttpTrigger; -import example.hello.model.*; +import com.example.model.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -279,10 +276,11 @@ Create a *src/test/java/com/example* folder and add the following JUnit tests: *HelloTest.java*: ```java -package example.hello; +package com.example; -import example.hello.model.Greeting; -import example.hello.model.User; +import com.example.hello.Hello; +import com.example.model.Greeting; +import com.example.model.User; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; @@ -422,7 +420,7 @@ Now go to the [Azure portal](https://portal.azure.com) to find the `Function App Select the function: - In the function overview, note the function's URL. -- Select the **Platform features** tab to find the **Log streaming** service, then select this service to check your running function. +- On the left menu, select the **Log streaming** service to check your running function. Now, as you did in the previous section, use cURL to access the running function, as shown in the following example. Be sure to replace `your-function-name` by your real function name. From e5b2261d6f50b01b59940a190bb97abd1121a750 Mon Sep 17 00:00:00 2001 From: Julien Dubois Date: Wed, 6 Dec 2023 11:26:19 +0100 Subject: [PATCH 2/2] Formatting --- .../getting-started-with-spring-cloud-function-in-azure.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/articles/java/spring-framework/getting-started-with-spring-cloud-function-in-azure.md b/articles/java/spring-framework/getting-started-with-spring-cloud-function-in-azure.md index 63bea5e2ea..4b13e5d0b9 100644 --- a/articles/java/spring-framework/getting-started-with-spring-cloud-function-in-azure.md +++ b/articles/java/spring-framework/getting-started-with-spring-cloud-function-in-azure.md @@ -60,10 +60,10 @@ Change those properties directly near the top of the *pom.xml* file, as shown in ```xml - 11 + 11 - - com.example.DemoApplication + + com.example.DemoApplication 1.29.0