This example assumes you have previously completed the following examples:
To build the JAR file use the following Maven command line.
mvn package
To run the example locally use the following Maven command line.
mvn spring-boot:run
az spring app create \
--name helloworld \
--service ${SPRING_NAME} \
--resource-group ${RESOURCE_GROUP} \
--assign-endpoint \
--runtime-version Java_11 \
--verbose
az spring app deploy \
--name helloworld \
--service ${SPRING_NAME} \
--resource-group ${RESOURCE_GROUP} \
--artifact-path ./target/spring-helloworld.jar \
--verbose
az spring app show \
--name helloworld \
--service ${SPRING_NAME} \
--resource-group ${RESOURCE_GROUP} \
--query properties.url \
--output tsv
You can verify the application works, now on Azure Spring Apps, by using your browser and going to the URL shown.
It should show you the following:
Hello World
Do NOT forget to remove the resources once you are done running the example.
- Commands to manage Azure Spring Apps
- Azure Spring Cloud Documentation
- Quickstart: Build and deploy apps to Azure Spring Cloud
6m