Deploy Java (Spring boot) application with MS-SQL database on Azure (Part 2)

Architecture

I — Create a Resource Group

  1. Connect to Azure Portal: https://portal.azure.com/
  2. Click on <Resource groups> and click on <+ Create> button
  • Subscription: Select your Azure subscription
  • Resource group: Enter the resource group name. For example: “azure-spring-mssql-rg”
  • Region: Select a Region from the list. Make sure to select the same region for all next resources. For Example: France Central
  • Click on <Review + Create>
Create Azure resource group

II — Create the database

  1. Connect to Azure Portal: https://portal.azure.com/
  2. Click on <Create a resource>
  3. Select <Database> in the left menu
  4. Click on <SQL Database> and select <Create>
Create Azure Database
Create Azure Database
  • Server name: enter “my-mssql-server-0123
  • Server admin login: enter “YOUR_ADMIN_LOGIN
  • Password: enter “YOUR_STRONG_PASSWORD
  • Location: select France Central (or any other region near you)
  • Click <OK>
Create Azure Database
Create Azure Database
Create Azure Database

III — Run the application locally using the newly reated database (Optional)

  1. Change your application.yml file
$> mvn spring-boot:run
Azure Data Studio

IV — Create the Azure Web App

  1. Connect to Azure Portal: https://portal.azure.com/
  2. Click on <Create a resource>
  3. Select <Web> in the left menu
  4. Click <Create Web App>. If not present, you can use the searching box and search for “web app
  5. Fill the form with tho following data:
  • Subscription: select your Azure subscription
  • Resource group: select the new created resource group. For example “azure-spring-mssql-rg”
  • Name: enter the web app name. For example: “azure-spring-mssql-app
  • Publish: select <Code>
  • Runtime stack: select <Java 11>
  • Java web server stack: select <Java SE (Embeded Web Server)>
  • Operating System: select <Linux>
  • Region: select France Central (or any other region near you)
  • Linux Plan: click <Create new> and enter a name for the new Linux Plan. For example “azure-spring-mssql-sp
  • Sku and size: click <Dev / Test> and select <F1> and then click <Apply>
Create Azure Web App
Create Azure Web App

V — Deploy the application

$> az login
$> mvn com.microsoft.azure:azure-webapp-maven-plugin:1.14.0:config
$> mvn package azure-webapp:deploy

Final step

  • For the application creation tutorial:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store