Skip to content

Latest commit

 

History

History
74 lines (40 loc) · 1.76 KB

File metadata and controls

74 lines (40 loc) · 1.76 KB

CI-CD-Java-Springboot-to-Azure-container-app

Install java and maven

Java  :   https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.exe 
maven :  https://dlcdn.apache.org/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.zip 

Extensions for vscode:

   1. Extension Pack for Java 
   2. Spring Boot Extension Pack  [which includes Spring Boot dashboard , Spring Boot initializer,Spring Boot tools]

building the code locally:

1 mvn spring-boot: run 
2.  a. mvn clean install 

    b. java -jar target/hello-0.0.1-SNAPSHOT.jar  (for eg: let snapshot be hello-0.0.1-SNAPSHOT.jar) 

                           OR 

    b. go to the Springboot dashboard and click on Run icon. Hit the required page. 

Testing the code locally:

To run all the test cases 
mvn test 

To run a particular test class 
mvn -Dtest=HelloTest test 

After testing locally push the code to ADO

Creating infrastructure in Azure through bicep script:

ACR 
ACA

Deploying the application to Azure Container App

  1. taken the compatible maven version , extracting it and doing the maven build in the pipeline. 

  2. Dockerised the application and build and pushed the image to ACR 

  3. Managed identity generated and passed it to authenticate newly created container app. Specified port and other configurations added.
Screenshot 2023-10-15 102818 Screenshot 2023-10-15 103044