This sample shows how to run Java 8 app in Azure Spring Apps.
-
Clone this repo and go to folder
git clone https://github.com/Azure-Samples/azure-spring-apps-samples cd azure-spring-apps-samples/java-8-sample
-
Package the app using maven
mvn clean package -D skipTests
-
Install Azure CLI extension for Azure Spring Apps
az extension add --name spring
-
Create an instance of Azure Spring Apps
az spring create -n <service name> -g <resource group name>
-
Create a public repo that only has the provided
application.yml
file -
Using the URI of that repo, configure Azure Spring Apps to pull config from it
az spring config-server git set --name <service name> -g <resource group name> --uri <my config git repo>
-
Create an app with public domain assigned
az spring app create -n <app name> -s <service name> -g <resource group name> --runtime-version Java_8 --is-public true
-
Deploy the newly created jar
az spring app deploy -n <app name> -s <service name> -g <resource group name> --artifact-path ./target/java8-ASC-demo-0.0.1-SNAPSHOT.jar
-
Using the output of the new app instance, retrieve the "App Instance Name" and use in the following command to review the logs
az spring app logs -f -n <app name> -s <service name> -g <resource group name>
-
Verify app is running. Instances should have status
RUNNING
and discoveryStatusUP
az spring app show -n <app name> -s <service name> -g <resource group name>
-
Visit the Azure portal to see further information about the application.