Posts

Showing posts from July, 2021

Microsoft Azure + Spring Cloud Sample application from the scratch

Image
  Objectives In this post, we will: Set up an Azure Spring Cloud cluster Configure a Spring Cloud Config Server Use a Spring Cloud Discovery Server Configure service binding Create and deploy a Spring Boot microservice Create and deploy a Spring Cloud Gateway Prerequisites Azure CLI Java 8  and an IDE cURL  or a similar HTTP utility Check version of Azure CLI, use Git bash to execute az --version az login # Sign into an azure account az account show # See the currently signed-in account. az account set --subscription <SUBSCRIPTION_ID> az extension add -n spring-cloud -y #If you haven't added this extension yet add it. Congratulations, the Azure CLI is now ready to create your first cluster! Create an Azure Spring Cloud instance RESOURCE_GROUP_NAME=spring-cloud-sample-rsgrp SPRING_CLOUD_NAME=azure-spring-cloud-unique9563 az group create \ -g " $RESOURCE_GROUP_NAME " \ -l eastus az spring-cloud create \ -g " $RESOURCE_GROUP_NAME " \ -n ...

Microsoft Azure - Spring boot application deployment

Image
 Step 1 - clone the project from :  git clone https://github.com/spring-projects/spring-petclinic.git  Step 2 - run the application locally using Bash like below cd spring-petclinic ./mvnw package java -jar target/*.jar  Step 3 - run the application locally using Bash like below Now you want to make the application ready for cloud(Azure) deployment  This project use java 8 Run below command at project path to add the necessary Azure deployment plugins for Maven mvn com.microsoft.azure:azure-webapp-maven-plugin:1.12.0:config It'll ask you for some inputs to provide according to your preference (eg: Azure pricing tier, OS) My screen: So, once you complete this step it'll automatically modify the pom.xml with below kind of settings Step 4 - Deploy the application with maven using below command mvn package com.microsoft.azure:azure-webapp-maven-plugin:1.12.0:deploy Congratulations! The app is successfully deployed to Azure App Service. You can visit the url abov...