When we consider cloud we might have suddenly something like sky and cloud in our mind right!!!!!. Yes that was my feeling when i heard this term very first time ,but now i got a new picture in my mind when someone speak about cloud. So before entry into our main topic, i will give some light on what cloud computing is and then i will proceed to the deployment job in cloud.
In our traditional approches we go for Physical space,Server,Storage,Database,networking,hardware,software all these stuffs with some professionals who can regurlarly work and look into it for hosting an application.It also does not provide features like scale up,scale out automatically.If we want to do these we need to do it manually say by buying some hardware,memory,etc with some high professional members who can look into it. It does not support disaster management.
So Cloud computing introduced to overcome such problem of Traditional approches and it is the delivery of Computing services like Server,Storage,Database,networking,hardware,software,etc over internet("Cloud").
It provide features like Vertical Scaling or Scaling Up.Scaling vertically is done by adding more resources to an existing work unit. For example, let’s say your web server is starting to underperform.
There are many ways to improve its scalability via vertical scaling. Adding more memory, cache, disk, or processors is one way.
one more option that cloud provide is to leave the existing machines in place, and add some additional machines to the work Unit to share the burden. This stratgy is called scaling out or horizontal scaling.
so this is the Quick introduction on cloud computing if i will try to write about the benifits of cloud then belive me it will only cover the full topic.
There are lots of compnies who are providing computing services, some of the well known companies are-
- Amazon Web Service
- Microsoft Azure
- Google Cloud Platform
- IBM cloud
So here we will particuarly target to a "Microsoft Azure" to perform our work.
Table of contents
- Introduction to Azure Portal
- Creating Sql Server Database in Azure
- Introduction to Data Migration Assistant Tool.
- Migrating the Local sql server Database to Azure Database
- Working with MVC(HMS) Project.
- Deploying the MVC project In Azure
- Testing Functionality of Hosted Site.
Introduction to Azure Portal
To work of diffrent kind of computing services provided by Azure,it has a web interface called the Azure portal that allows administrators to access and manages various kind of computing services.The Microsoft Azure portal is a central place where you can provision and manage your Azure resources. This tutorial will familiarize you with the portal and show you how to use some of these.
To work in with this Portal you have to create an account in this portal.It provide 30 days trail pack with Rs 13300 creadit limit to a normal test on this account.The credit is valid for 1 month only and will expire after month,and one more thing this is actually based on your using the credit limit start deducting on the basic of of using of resources in Portal.
Once you create an account,it will ask for free subscription,It will take your Credit Card or DabitCard detail for subscribe your free balance.
I have collected few links if any one want to know more about the service,can ckeck the link.
So the first step is to create a DataBase for the application we want to deploy.Note we have already have some database schema ,we just need to migrate them.
So here is the procedure to create a new Database in azure
Create a new Database in Azure
To create a new database in Azure please follow the below points.
- Log in to the Azure portal.
- Select SQL Databases from the page, and then select Create rSQL Database as shown below.
- Fill out the SQL Database form with the following information, as shown on the image below:
Note:-There are some restriction on naming convention,you should follow there rules where creating it.
Here is the server details clearly mentioned.
Note:-For azure we have 3 data center in india,these are-
- Central India-Pune
- West India-Mumbai
- South India-Chennai
As we are from Bangalore,so the south india data center is nearer to us,thats why here the location we choosed is South India.
If any one is not clear about datacenter let me explain this.
A DataCenter is a dedicated centrailized location where all the computing and networking equipment are provided for collecting,storage and management of large amount of data.These data center have features like.
- Dedicated space for housing infrastracture.
- High bandwidth internet provider.
- Efficient air cooling system.
- Dust free enviroment.
- High physical security.
- Disaster Management.
- High qualified,high professional members who can look into it
- Once every thing you filled in that database form click Create button to create a database.
- Once the database is done you need to specify the Firewell rules.Initially, all Transact-SQL access to your Azure SQL server is blocked by the firewall.
To begin using your Azure SQL server, you must specify one or more server-level firewall rules that enable access to your Azure SQL server.
To set a server-level firewall rule from the database overview page, click Set server firewall on the toolbar as shown in the following image: The Firewall settings page for the SQL Database server opens.
Thats all now you have successfully created your database.
Before hosting any application to the cloud actually the development process normally starts from local machine(eg.from your local Visual studio and SQL Server).Similarly i have created my database and project in my local machine.Here is the database structure in my local machine.
Introduction to Data Migration Assistant Tool
Data Migration Assistant is a tool for migrating our local database to azure sql server.DMA is a valuable tool and has a lot of features to help you in successful SQL Server Migration. DMA analyzes your source SQL Server instance against your target SQL Server instance (newer/upgraded version) and prepares a comprehensive report to tell you how you will be able to achieve your migration successfully.
Here are the some steps to migrate the data.
- For use Data Migration Assistance(DMA) tool you need to download the tool.You can download the tool from here.
- Once you download the setup ,please install it in your local Pc.Once you installed click to start.
- Give a project Name and put the source DB type and Target DB type to start.Click create to start.
After that fill all the source(your local sql database details) and click connect to see all the databases in the screen.
- Now second thing is to select your database want to migrate(HMS).
- Now enter the Target server details for connecting the target details.
- Once all done ,select the db objects to be migrate.
- Now click the Generate script to generate the script.
- See all the data in the screen apper.
- Now Click the Migrate button to select the table for Migration.
- After that Start Migration.
Thus your data is migrated completely to your Azure SQL database.Now Login with your Azure server detail in Sql server to see the Database in Azure.
- Check the Dabebase it created will all scheme structure.
Now to check the data, write a simple query.
Thus the data is completely migrate to Azure.
Azure Web Apps enables you to build and host web applications in the programming language of your choice without managing infrastructure. to create web apps search for web apps in portal and select it.
Now after creating It will give some application info ,just note down and save it.
Working with MVC(HMS) Project
Here i have given the full description of Hospital Mangement Project(HMS),If any one want to explore it here is the link provided.
Iclinic or HMS is a platform which bridges the gap between the doctors,patients and clinic. This platform is concerned about end to end consultation between the doctors and patients via the medium of digitating clinical Ticketing system.
In order to achive this facility we have provided a portal where a patient can register his symptoms,get a online ticket, later can consult with any of the collabarated clinic.During his/her visit to clinic they need to quote the registration id which will be later process by doctor.
here is the complete project structure in my Local machine.
Change the connection string from local to the Server machine.I have done this basic modification in my projects.
Now Right click and Publish the Project
Deploying the MVC project In Azure
Publish the project as shown below.
Here you will get the following options while publishing your project.
Choose Microsoft Azure App Service and click on Publish Button
Note you should login to your Azure account while Publishing this.It will automatically take your Web app name and required fields.
Once done it will automatically started and will automatically browsed.
Hope you will like this explanation,if you have any doubt in this you can comment or reach me in my mentioned email id.If yu have any suggestation regarding any work,please let me know so that even i will lern from you.
Initial Release-28-Dec-2017(Last article of 2017).
Wishing U all Happy New Year in Advance!!!