Create And Connect SQL Server And Database On Windows Azure

Introduction

Windows Azure SQL database contains complete features of relational database and it is known as SQL Azure. If you want to use Azure, you first need to visit manage.windowsazure.com and subscribe to this service.

Before you subscribe to Windows Azure, please make sure that you read the pricing details of various services before you start using them. You can also get a free trial subscription to get started. Once you login on the portal, the following image shows some service/features that can be accessed. So, I will demonstrate how to create SQL Server and SQL Database on Windows Azure.

Windows Azure

To create a Windows Azure SQL Server and SQL Database, first you need to login to Windows Azure Management Portal. When you login with Azure Portal, the first screen will be as follows:

Management Portal

So, to create an SQL Server, you need to choose SQL DATABASE option from the menu and choose SERVERS. If you are using it for the first time, then there will not be any database or server that will be added.

choose SQL DATABASE option

To add new SQL Server, click on ADD and it will open a popup dialog box, where you can specify the detail of SQL Server.

detail of SQL Server

After filling all the required details, click on OK and you will see it is going to create a new server for you.

new server

It will take a few minutes to complete this operation. When it will be ready for you, it will ask to enable some settings for this server like firewall settings. Choose ENABLE NOW.

Choose Enable Now

You need to enable the default auditing settings and click on SAVE.

enable the default auditing settings

click on SAVE

Now go to SQL Database Menu again and choose SERVER, you will find here a server has been added. So, to add new database click on NEW.

SQL DATABASE

Choose SQL DATABASE and then Custom Create and fill your database name and choose your server where you want to create the database.

Custom Create and fill your database name

It will take a few minutes to create a new database for you. You can see the message in STATUS as in the following screenshot.

creating message in status

After creating, go to the DATABASES and you will find that the TestEmployee database created successfully.

TestEmployee Database

Finally, we have created SQL Server and Database successfully. So, now the time is to access it using Microsoft SQL Server Management Studio. Open Microsoft SQL Server Management Studio and fill in the required details such as server name, user name and password.

Server Management Studio

You will not be able to connect with this server because your IP is not configured with this server. To add your IP, you need to configure your IP.

configure

Pass your rule name, Start IP and End IP [Both can be the same] and Save. You can try again to access your server, but unfortunately you will not be connecting to server.

connecting to server

It is because this is asking for secure connection. So, to make it a secure connection, you need to modify "servername.database.windows.net" to "servername.database.secure.windows.net" server name as in the following screenshot:

server

When you try to connect it again, it will be connected successfully and you will see your database.

database

Conclusion

So, you learned how to create SQL Server and Database on Windows Azure step by step and also how to connect with database that is created on Windows Azure.