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 Cloud

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

Prerequisite

How to run

  1. Clone this repo and go to folder

    git clone https://github.com/Azure-Samples/Azure-Spring-Cloud-Samples
    cd Azure-Spring-Cloud-Samples/java-8-sample
  2. Package the app using maven

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

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

    az spring-cloud 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 Cloud to pull config from it

    az spring-cloud config-server git set --name <service name> --uri <my config git repo>
  7. Create an app with public domain assigned

    az spring-cloud app create -n <app name> -s <service name> -g <resource group name> --is-public true
  8. Deploy the newly created jar

    az spring-cloud app deploy -n <app name> -s <service name> -g <resource group name> --jar-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-cloud app logs -f -n <app name> -i <App Instance Name>
  10. Verify app is running. Instances should have status RUNNING and discoveryStatus UP

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