Skip to content

Latest commit

 

History

History

java-8-sample

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Run Java 8 app in Azure Spring Apps

This sample shows how to run Java 8 app in Azure Spring Apps.

Prerequisite

How to run

  1. 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
  2. Package the app using maven

    mvn clean package -D skipTests
  3. Install Azure CLI extension for Azure Spring Apps

     az extension add --name spring
  4. Create an instance of Azure Spring Apps

    az spring create -n <service name> -g <resource group name>
  5. Create a public repo that only has the provided application.yml file

  6. 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>
  7. 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
  8. 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
  9. 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>
  10. Verify app is running. Instances should have status RUNNING and discoveryStatus UP

    az spring app show -n <app name> -s <service name> -g <resource group name>
  11. Visit the Azure portal to see further information about the application.