How to Deploy an Angular Application in Azure: Azure Database for Mysql Server
What is Azure?
Azure is a complete cloud platform that can host your existing applications and streamline new application development. Azure can even enhance on-premises applications. Azure integrates the cloud services that you need to develop, test, deploy, and manage your applications, all while taking advantage of the efficiencies of cloud computing.
By hosting your applications in Azure, you can start small and easily scale your application as your customer demand grows. Azure also offers the reliability that’s needed for high-availability applications, even including fail-over between different regions.
so this article going to be the series article, In here, I will explain How to Setup Azure for deploy your Angular application in Linux so You can also setup Microsoft Azure Services for deploy your Angular web application for back-end used Spring boots within 5 steps(You can see What I have do with Azure as ARM templates[here attached my github repository link so you can that] ). lets see…one by one…
Step 1. Setup Azure Database For MySql Server
Azure Database for MySQL is a relational database service. It’s a fully managed database as a service offering that can handle mission-critical workloads with predictable performance and dynamic scalability. Develop applications with Azure Database for MySQL leveraging the open-source tools and platform of your choice. so lets see, how to use Azure Database for MySQL step by step.
Through the link https://portal.azure.com you can get Azure portal. then you need do click on menu button and click All services →Databases →Azure Database For MySql Servers or Search Azure Database for MySQL servers or Select Azure Database for MySQL servers in home.
Then click Click the Add button to add new Azure Database for MySQL server.
After that you have to fill the fields in Create . You need select the Subscription you are going to manage deployed resources and costs. then for Resource group(It’s like folders to organize and manage all your resources) you can select existing resource group if you already have otherwise you can create new through click on create new. Then you required settings for the server, including server name(character between 3–63, lowercase letters,numbers and hyphens then server should be available), picking a location and configuring the compute and storage resources. at the end usually you have to fill Admin username and Password to access the database(It’s want for future access so Keep this secretly ).
Then Click Review+create button. That’s it We created Azure Database For MySql Server Successfully. It’ll take some times…..
so Next we need to Access MySQL server.
Access SQL Server with command terminal
You can install MySQL Workbench and can access through it. But here I have to do with command prompt/terminal.
mysql -h Server_name -P 3306 -u Server_admin_name -p
Through above command(for ubuntu ), You can monitor the Sql Server through it(for that you have to type the Server Password.)Now you can create database on terminal used create Database database_name and then can used create table and query to access the database as usual.
Then You Need to do below changes in Your Application for deploying. If you Don’t have any project on hand, you can go through the below link to see the sample project.(Github link)
The changes on application.properties:-
Then make changes on pom.xml inside the build tag(<build>) add below code:-
<! — Begin of App Settings →
<! — End of App Settings — !>
If you used java version 11 change that as a 8 because i got error when put ‘jre11’ not support to me and i got issue on region so if got error by that changed various region(prices may changed) and check that.
after this we need to build .jar file for deploy the on Azure. Open terminal inside the Editor and execute below command
mvn clean package
yes, we do it successfully…… Deployment is finished successfully.. for check it go to Azure portal and check under App Services on it app details will displayed.We have still some Azure services which will needed for our application. so lets see in next blog… and that’s about How deploy an angular application with azure storage.