Create SQL Server Database in Microsoft Azure

In this blog, we will learn, how to create and set up SQL Server database in Microsoft Azure. We previously saw-
You must have a Microsoft Azure account, in order to perform the steps, given below. You can create an account on Microsoft Azure, using the link.
 
Let’s Begin,

First of all, you need to login to Microsoft Azure portal.



Click SQL database to open SQL database blade.

 

Click Add SQL database.

 
Type a valid name for your database. Select source and select blank database. You can also select the sample database like AdventureWorks etc.

 

Click Configure required settings and click create a new Server on the Server blade. Fill Server name and Server admin login details. Click select.

 

Choose your pricing tier and click create.

 

Within a few minutes, you will see an online status in SQL database blade, which means our database is ready for use. Click SQL database name i.e. MyAzureDB. 

 

In order to connect your Application to the database, you need a connection string. Click show database connection string.

 

You will get the connection strings for ADO.NET, ODBC, PHP etc. Applications.

 
If you try to connect your database to your local SQL Server, you will get an error i.e. “Cannot connect to Server”. To enable access, we have to configure Firewall level settings in Azure portal.

 

Go to SQL Server database and select your database. Click more links and subsequently click set Server Firewall.

 

Click Add Client IP or you can allow a range of IP addresses in Firewall setting blade.

 
Afterwards, you will see your client IP Address is added to your Firewall settings.

 
Click save button.

 
If everything is fine, you will get a success message.

 

Now, open Visual Studio, go to Server Explorer and click Add Connection.

 
Enter your database information and click OK in order to connect.

 
 
 
You can also open your SQL Server, fill the Server details and click connect. Cheers! We have successfully connected to SQL Server database, hosted in Microsoft Azure.