Git Product home page Git Product logo

azureproj2's Introduction

Deployment of Java application through Azure Devops Pipeline, Azure Repos, ACR, Azure Kubentes Service

We have deployed banking application in capstone project1 using jenkins, github, dockerhub, ansible, kubernetes, we will take the same application and deploy through Azure Devops, Azure Repos, Azure container registry, Azure Kubentes Service.

1. Import the repository:

We will create a new project in Azure DevOps and then go to Repo and click on Import a Repository

We have already created gihub repo for the capstone1 project: https://github.com/kotianrakshith/CapstoneProject1

We will import this:

We can see after the import all the files are imported:

(Later we will delete all the files not needed ex. Jenkinsfile.)

2. Build the Java application

We wiill go to pipeline and create a new pipeline:

In the first step we will chose repo as Azure Repos Git and then our repo:

Then we will chose maven and only chose package:

Then we will have our pipeline code till the build .

We will change our pool to our default pool as we are using our local machine to build(not yet authorized to use microsoft hosted agent)

Then we will save and run.This will be saved in the azure repo.

We see that run is completed sucessfully

3. Build and push the image to azure container registry

First let us create a container registry:

Go to container registries in azure portal:

Click create.Give a name and other details and click review and create:

Now we will go the pipeline and add the build and push to containe registry steps:

Edit the pipeline and add the task:

We will get below code to add:

We had to install docker in the local system to run this, but once done then it runs successfully:

Then we can see in the azure container registries that docker image is pushed:

4. Create Kubernetes cluster:

We will go to kubernetes services in Azure DevOps and click create kubernetes cluster:

We will give the required details:

In integration settings we will integrate container registry and default log analytics workspace:

You can then review and create.

Once deployment is successful you should be able to see the cluster created

5. Deploy the app to kubernetes:

We will now edit the pipeline to add the kubernetes task:

To make the pipeline reusable we will add delete action below this code:

We have added continueOnError: true so that it build can proceed even if this fails.(if there is no deployment/service it will fail)

After making few small changes in previous manifest file and the pipeline, our run was successful:

6. Check the deployment and access the app:

In AKS, we can go to the workloads to see our deployment:

We can see that orbitbankapp is deployed.

In Services and ingresses, we can see that service is also deployed:

In this page we can see externalIP given.

We can access to required app page in

http://20.81.109.230:8989/bank-api/swagger-ui.html

(externalip:port/pagelink)

As you can see we are able to access:

And also navigate:

That completes this project. We have used the same code from capstone1 but we have used azure tools like Azure Devops, Azure Repos, Azure container registry, Azure Kubentes Service to achive the same results much easily.

azureproj2's People

Contributors

kotianrakshith avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.