Giter Club home page Giter Club logo

deploy-spring-boot-to-azure's Introduction

Deploy Spring Boot Applications to Azure using Azure Web Apps

Image

Take your first steps towards cloud with Azure Web Apps. Deploy REST APIs, Full Stack Applications, Web Applications and Containers to the cloud.

Spring Boot is the No 1 Java Framework to develop REST API and Microservices. Azure is the One of the Top Cloud Service Providers today.

How about learning Azure by deploying Spring Applications to Cloud using Azure Web Apps and Azure App Service?

Getting Started

Installation Guides

Required Tools

  • Node v8+ for npm
  • Visual Studio Code - Latest Version
  • Java 8+
  • Eclipse - Oxygen+ - (Embedded Maven From Eclipse)
  • Git
  • Docker
  • ELB CLI

Installing Guides

Troubleshooting Installations

Course Overview

In this course, we deploy a variety of Spring Boot Applications to the Cloud:

  • REST APIs - Hello World and Todo - JAR
  • Todo Web Application WAR
  • Full Stack Application with React and Spring Boot
  • Single Container with REST API
  • Multi Container with Todo REST API talking to MySQL

This course would be a perfect first step as an introduction to Azure and the Cloud.

You will learn about automating deployments with Azure and creating a continuous delivery pipeline with Azure DevOps. You will learn how to Auto Scale applications based on load as well as deploy multiple instances behind a load balancer using Azure App Service.

You will be using a number of Azure Services - Azure App Service, Azure Web Apps, Azure DevOps, Azure Database for MySQL Services, Resource Groups, Azure App Service Plans and Azure Subscriptions.

You will be using deploying a variety of Java Spring Boot projects to Azure (Azure). These projects are created with React (Frontend Framework), Spring Boot (REST API Framework), Spring (Dependency Management), Spring Security (Authentication and Authorization - Basic and JWT), BootStrap (Styling Pages), Maven (dependencies management), Node (npm), Visual Studio Code (TypeScript IDE), Eclipse (Java IDE) and Tomcat Embedded Web Server. We will help you set up each one of these.

What you'll learn

  • You will Learn the Fundamentals of Azure from Zero, no previous experience required
  • You will learn to deploy Spring Boot REST API to Azure with Azure Web Apps
  • You will learn to deploy Java, Spring Boot Full Stack Applications to Azure with Azure App Service
  • You will be using a number of Azure Services - Azure App Service, Azure Web Apps, Azure DevOps, Azure Database for MySQL Services.
  • You will learn to deploy containerized Java Spring Boot applications to Azure
  • You will learn to create a continuous delivery pipeline with Azure Devops
  • You will learn how to Auto Scale applications based on load as well as deploy multiple instances using Azure Web Apps.
  • You will Join 300,000 Learners having AMAZING LEARNING Experiences with in28Minutes

Requirements

  • You have an attitude to learn while having fun :)
  • You have some programming experience with Java, Spring and Spring Boot
  • You have a valid debit or credit card to create a Azure Account
  • You DO NOT need to have any experience with Azure

Step By Step Details

Getting Started with the course

  • Step 00 - Deploying Spring Boot Applications with Azure Web Apps - Introduction
  • Step 01 - Getting Started with the Course

Getting Started with Azure

  • Step 01 - Creating an Azure Account
  • Step 02 - 10000 Feet Overview of Cloud, Azure and Azure Web Apps

Getting Started with Azure Web Apps

  • Step 01 - Getting started with Azure Web Apps - Creating First Application and Environment
  • Step 02 - Quick Exploration of Azure Web Apps
  • Step 03 - Quick Introduction to Azure App Service Plans
  • Step 04 - Quick Introduction to Kudu Console
  • Step 05 - Searching efficiently for Azure resources and deleting Resource Groups
  • Step 06 - Exploring Cloud Best Practices - Minimize Costs

Deploying Java Spring Boot Hello World REST API to Azure Web Apps

  • Step 01 - Importing Four Spring Boot Projects from Github
  • Step 02 - Running 01 Spring Boot Hello World Application in Local
  • Step 03 - Deploy Spring Boot Application to Azure Web Apps - 1 - Azure Web App Maven Plugin
  • Step 04 - Deploy Spring Boot Application to Azure Web Apps - 2 - Install Azure CLI
  • Step 05 - Deploy Spring Boot Application to Azure Web Apps - 3
  • Step 06 - Deploy Spring Boot Application to Azure Web Apps - 4 - Deploying new version
  • Step 07 - Review Log Streams and Tail Web App Logs using Azure CLI
  • Step 08 - Exploring Cloud Best Practices - Regions

Deploying Java Spring Boot H2 Web App to Azure Web Apps

  • Step 01 - Running 02 Spring Boot H2 Web App on Local
  • Step 02 - Deploying 02 Spring Boot H2 Web App WAR to Azure Web Apps
  • Step 03 - Testing 02 Spring Boot H2 Web App Azure Deployment
  • Step 04 - Exploring Cloud Best Practices - Azure Resource Management

Deploying Java Spring Boot Web App talking to MySQL with Azure App Service

  • Step 01 - Code Review of 03 Spring Boot MySQL Web App
  • Step 02 - Running MySQL as Docker Container on Local
  • Step 03 - Connect 03 Spring Boot MySQL Web App to MySQL on Local
  • Step 04 - Creating MySQL Database in Azure
  • Step 05 - Deploy 03 Spring Boot MySQL Web App to Azure Web Apps
  • Step 06 - Connect 03 Spring Boot App to Azure MySQL Database - Environment Variables
  • Step 07 - Using Azure Cloud Shell to Create Database
  • Step 08 - Connecting to Azure MySQL for Local Machine
  • Step 09 - Create Azure MySQL Database using Azure CLI
  • Step 10 - Delete Resource Groups for Azure Web Apps and Databases

Deploying Java Full Stack Spring Boot React App with Azure App Service

  • Step 01 - Exploring 04 Java Full Stack Spring Boot React App
  • Step 02 - Running React Frontend in Local
  • Step 03 - Deploying Java REST API Backend using Azure App Service
  • Step 04 - Deploying React Frontend using Azure App Service

Deploying Containerized Java Applications with Azure Web Apps

  • Step 01 - Code Review for 05 Single Container Java Spring Boot REST API
  • Step 02 - Creating and Running Local Docker Image for 05 Java Spring Boot REST API
  • Step 03 - Pushing Java Spring Boot REST API Docker Image to Docker Hub
  • Step 04 - Deploying Java Spring Boot REST API Docker Image to Azure App Service - Part 1
  • Step 05 - Deploying Java Spring Boot REST API Docker Image to Azure App Service - Part 2
  • Step 06 - Running 06 Multi Container Java Spring Boot App with MySQL on Local
  • Step 07 - Running 06 Multi Container Java Spring Boot App with MySQL using Docker Compose
  • Step 08 - Deploying Docker Compose Java Spring Boot App with MySQL to Azure - Part 1
  • Step 09 - Deploying Docker Compose Java Spring Boot App with MySQL to Azure - Part 2

Azure App Service - Creating Auto Scaling Environments

  • Step 01 - Exploring Manual Scaling and ARR Affinity of Azure Web Apps
  • Step 02 - Exploring Auto Scaling features of Azure App Service
  • Step 03 - Creating Deployment Slot for Staging Environment
  • Step 04 - Swap Stage and Production Environments - Blue Green Deployment
  • Step 05 - Exploring Canary Deployments with Azure App Service

Continuous Delivery for Java Spring Boot Applications with Azure DevOps

  • Step 01 - Getting Started with Continuous Delivery - Create Github Repository
  • Step 02 - Setup Azure DevOps for Continuous Delivery to Azure App Service - Part 1
  • Step 03 - Setup Azure DevOps for Continuous Delivery to Azure App Service - Part 2

Conclusion

  • Step 01 - Delete All Resource Groups and Thank You

Diagrams

graph architecture {

node[style=filled,color="#59C8DE"]
//node [style=filled,color="#D14D28", fontcolor=white];
rankdir = TB
node[shape=record]

ManagementGroup -- Subscription1
ManagementGroup -- Subscription2
Subscription1 -- ResourceGroup1
Subscription1 -- ResourceGroup2
Subscription2 -- ResourceGroup3
Subscription2 -- ResourceGroup4
ResourceGroup1 -- WebAppRestApi
ResourceGroup1 -- WebAppFrontEnd
ResourceGroup2 -- Database
ResourceGroup3 -- Resource1
ResourceGroup4 -- Resource4
ResourceGroup4 -- Resource2
ResourceGroup4 -- Resource3

ManagementGroup[label=<Management Group>]
Subscription1[label=<Subscription - Dev>]
Subscription2[label=<Subscription - QA>]

ResourceGroup1,ResourceGroup2,ResourceGroup3,ResourceGroup4[label=<Resource Group>]
WebAppRestApi[label=<Spring Boot REST API>]
WebAppFrontEnd[label=<React Front End App>]
Database[label=<MySQL Database>]
Resource1,Resource2,Resource3,Resource4[label=<...>]
}

Commands Executed during the course


az --version
az login

mvn azure-webapp:config
mvn azure-webapp:deploy

az webapp log tail --name hello-world-rest-api-in28minutes --resource-group hello-world-rest-api-rg

docker run --detach --env MYSQL_ROOT_PASSWORD=dummypassword --env MYSQL_USER=todos-user --env MYSQL_PASSWORD=dummytodos --env MYSQL_DATABASE=todos --name mysql --publish 3306:3306 mysql:5.7

az webapp restart --name todo-web-application-mysql-in28minutes --resource-group todo-web-application-mysql-rg

az webapp log tail --name todo-web-application-mysql-in28minute--resource-group todo-web-application-mysql-rg

#Cloud Shell
mysql --host todo-web-application-in28minutes.mysql.database.azure.com --user todosuser@todo-web-application-in28minutes -p

#MySQLSh
mysqlsh todo-web-application-in28minutes.mysql.database.azure.com --user todosuser@todo-web-application-in28minutes
\sql
use todos;
select * from todo;
mysqlsh todo-web-application-in28minutes-command-line.mysql.database.azure.com --user todosuser@todo-web-application-in28minutes-command-line -p

az extension add --name db-up

az mysql up -g in28minutes-database -s todo-web-application-in28minutes-command-line -d todos -u todosuser -p YOUR@PASSWORD1

# Environment Variables
RDS_HOSTNAME - todo-web-application-in28minutes.mysql.database.azure.com
todo-web-application-in28minutes-command-line.mysql.database.azure.com
RDS_PORT   - 3306
RDS_DB_NAME  - todos
RDS_USERNAME - todosuser@todo-web-application-in28minutes
todosuser@todo-web-application-in28minutes-command-line
RDS_PASSWORD - 

az webapp up --name frontend-full-stack-in28minutes --plan ServicePlan763a680f-840a-4de0 --resource-group rest-api-full-stack-rg --location westeurope

az webapp up --name frontend-full-stack-in28minutes --plan ServicePlan763a680f-840a-4de0 --resource-group rest-api-full-stack-front-end-rg --location westeurope

watch -n 0.1 curl https://hello-world-rest-api-v2-in28minutes.azurewebsites.net/hello-world-bean-list

npm install
npm start
npm run build

az webapp log tail --name todo-web-application-mysql-in28minutes --resource-group todo-web-application-mysql-rg


az group create --name container-resource-group --location westeurope
az appservice plan create --name container-service-plan --resource-group container-resource-group --sku P1v2 --is-linux
az webapp create --resource-group container-resource-group --plan container-service-plan --name todo-rest-api-h2-container --deployment-container-image-name in28min/todo-rest-api-h2:1.0.0.RELEASE


docker run --detach --env MYSQL_ROOT_PASSWORD=dummypassword --env MYSQL_USER=todos-user --env MYSQL_PASSWORD=dummytodos --env MYSQL_DATABASE=todos --name mysql --publish 3306:3306 mysql:5.7
docker stop 4ff5238b9464ed7050b89ef137e1b86bbf27c21aa74d5b62090f8fc3e86b4d17
docker rm 4ff5238b9464ed7050b89ef137e1b86bbf27c21aa74d5b62090f8fc3e86b4d17
docker run --detach --env MYSQL_ROOT_PASSWORD=dummypassword --env MYSQL_USER=todos-user --env MYSQL_PASSWORD=dummytodos --env MYSQL_DATABASE=todos --name mysql --publish 3306:3306 mysql:5.7
docker run --name todos-api --publish 5000:5000 --link mysql:mysql in28min/todo-rest-api-mysql:1.0.0.RELEASE

docker-compose --version
docker container ls
docker container stop f25f59ebec84
docker container rm f25f59ebec84
docker-compose up

az group delete --name hello-world-rest-api-rg
az webapp restart -name hello-world-rest-api-in28minutes --resource-group hello-world-rest-api-rg
az provider list
az group delete --name container-resource-group --yes
az group delete --name hello-world-rest-api-rg

cd /in28Minutes/git/hello-world-rest-api-azure-pipelines 
git init
git add *
git status
git commit -m "first commit"
git remote add origin https://github.com/in28minutes/hello-world-rest-api-azure-pipelines.git
git push -u origin master


git status
git add *
git commit -m "V10 change"
git push -u origin master

password - password@123

PRODUCTION - v1
DATABASE_URL -> PROD_URL Deployment Slot Setting

STAGE - V2
DATABASE_URL -> STAGE_URL Deployment Slot Setting
NEW_SETTING 


For Future

az webapp show   --name todo-web-application-h2-2111 --resource-group in28minutes-02
az webapp config show  --name todo-web-application-h2-2111 --resource-group in28minutes-02
az webapp deployment slot list  --name todo-web-application-h2-2111 --resource-group in28minutes-02
az webapp list
az webapp list-runtimes

Troubleshooting

Youtube Playlists - 500+ Videos

Click here - 30+ Playlists with 500+ Videos on Spring, Spring Boot, REST, Microservices and the Cloud

Keep Learning in28Minutes

in28Minutes is creating amazing solutions for you to learn Spring Boot, Full Stack and the Cloud - Docker, Kubernetes, AWS, React, Angular etc. - Check out all our courses here

deploy-spring-boot-to-azure's People

Contributors

in28minutes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  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.