We are going to learn how to Automate build and deployment of Springboot Microservices App into Azure Kubernetes Cluster(AKS) using Jenkins pipeline.
Sample springboot App Code:
I have created a sample Springboot App setup in GitHub. Click here to access code base in GitHub.
Jenkins pipeline will:
- Automate maven build(jar) using Jenkins
- Automate Docker image creation
- Automate Docker image upload into Azure container registry
- Automate Deployments to Azure Kubernetes Cluster
1. AKS cluster needs to be up running. You can create AKS cluster using any of one of the below options:
- Create AKS cluster in Azure portal directly
- Create AKS cluster using Azure CLI
- Create AKS cluster using Terraform
Step #2 - Create Credentials for connecting to AKS cluster using Kubeconfig
Click on Global credentials

use secret file from drop down.
Make sure you change values as per your settings highlighted in yellow below:
To avoid charges from Azure, you should clean up unneeded resources. When the cluster is no longer needed, use the az group delete command to remove the resource group, container service, and all related resources.
az group delete --name myResourceGroup --yes --no-wait