A Step-by-Step Guide to Setting Up Azure Database and SQL Server in the Azure Portal
Tags: azure, tutorial, cloud, database
Published: 2023-07-14 20:48:38

## Introduction:
Welcome to this comprehensive guide on setting up Azure Database and SQL Server in the Azure Portal. Azure offers a powerful and scalable cloud-based infrastructure that enables organizations to store, manage, and analyze their data efficiently. In this blog, we will explore the step-by-step process to establish Azure Database and SQL Server, empowering you to leverage the full potential of Azure’s robust database services.

---

## Step 1: Sign in to the Azure Portal

To get started, navigate to the Azure Portal (https://portal.azure.com) and sign in using your Azure account credentials. If you don’t have an Azure account, you can create one for free.

---

## Step 2: Create a new resource group
A resource group is a logical container for resources within Azure. To create a new resource group, follow these steps:

1. On the Azure Portal dashboard, click on “Create a resource” or navigate to the “Resource groups” section.

    ![Create a resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4z0qpwuufxgqg1v9kfm8.png)



2. Click on “Create” to create a new resource group.


    ![new resource group](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05wpwkoexxfq20fvucv1.png)


3. Provide a name for the resource group, choose the desired subscription, and select a region.

    ![Provide details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hu6kz6weiapfigtbugdg.png)



4. Click on “Review + Create” and then “Create” to create the resource group.


    ![Create page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9ys8jl68na2xri39z9ms.png)

---

## Step 3: Create an Azure SQL Server
Azure SQL Server is a fully managed relational database service. Follow these steps to create a new SQL Server:

1. In the Azure Portal, click on “Create a resource” and search for “SQL Server.”


    ![Search SQL server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/um2towxtjn5rvaygk68c.png)


2. Select “SQL Server (logical server)” from the search results and click on “Create.”


    ![Click on SQL server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kmrnye257ht958zt40pv.png)


3. Choose the desired Subscription, Resource group (create a new one or select an existing one), Server name (should be unique) and Location.

    ![Create SQL Database server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d7iamr417rvf20orj2hx.png)



4. Set the Azure AD admin. For the testing purpose, I am setting myself as a admin. The admin will be having higher privileges, so make sure to select the ones, whom you want to provide the admin access.

    ![Set Azure AD admin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kilb89o6if7y7gpi9cfs.png)



5. Select the Authentication method and add the server admin login and password.


    ![Select authentication method](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0o01uzmwc2m3iyriddi.png)


6. Configure the additional settings, such as version, performance, and networking.

7. Click on “Review + Create” and then “Create” to provision the Azure SQL Server. Wait for some time, as the azure will take some time for the deployment of the SQL Server.

    ![Review and create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jb5ulbir8cawb9a3jycw.png)

---

## Step 4: Configure firewall settings for Azure SQL Server
By default, Azure SQL Server has firewall rules that block all external connections. To allow connections to your SQL Server, follow these steps:

1. In the Azure Portal, navigate to the resource group containing your SQL Server.

2. Click on the SQL Server resource to open its overview page.

3. In the left menu, under “Security,” click on “Networking”.


    ![Networking](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hv9s77cfmbmn3sk88b73.png)


4. Click on “Add your client IPv4 address” to add your current IP address to the firewall rules.

    ![Add your IP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvq54e0mecp88lnpix3p.png)



5. If you require access from specific IP ranges or Azure services, you can configure additional firewall rules accordingly.

6. Click on “Save” to apply the changes.

    ![Click on save](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nxmi6ce847ykur4o4p29.png)


---

## Step 5: Create an Azure Database
Now that we have a SQL Server, let’s create a database within it:

1. In the Azure Portal, navigate to your SQL Server resource.

2. Click on “Create database” to initiate the database creation process.


    ![Create database](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7j553jzkly0ivdr51kzr.png)


3. Provide a name for the database, select the workload environment, Compute + storage. For the testing, I have selected the Standard-series (Gen5).


    ![Setup](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2btcuu50ynb0vyiv7pur.png)


4. Desired source (blank database or sample), and configure additional settings such as collation and security.

5. Click on “Create” to create the Azure Database. Wait for some time until azure finishes the deployment of the database.


    ![Create page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kxphvttzc8mv6jsfjh8t.png)

---

## Step 6: Connect to Azure SQL Server using SSMS
To manage your Azure SQL Server and databases, you can use SQL Server Management Studio. Here’s how to connect to your Azure SQL Server using SSMS:

1. Download and install SQL Server Management Studio from the official Microsoft website (https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms).

2. Open SSMS and click on “Connect” to open the “Connect to Server” window.

3. Fill in the necessary details.

    **· Server type:** Database Engine

    **· Server name:** Enter the fully qualified server name for your Azure SQL Server (e.g., myserver.database.windows.net). To find the server name. Go to Overview page of the database.

    **· Authentication:** Select “SQL Server Authentication”

    **· Login:** Enter the server admin login you provided during SQL Server creation

    **· Password:** Enter the server admin password

4. Click on “Connect” to establish a connection with your Azure SQL Server.

![login](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/771tisn8gt3fk0crnk33.png)



**Note:** Make sure to delete the resource group, if you are creating the above setup only for testing. It’s fine, if you’re in Free Tier. For Pay-as-you-go subscription, you will be charged for the resources.

---


## Conclusion:
Congratulations! You have successfully set up Azure Database and SQL Server in the Azure Portal. In this blog, I guided you through the steps of creating an Azure SQL Server, configuring essential settings, and creating a database. Azure provides a reliable and scalable cloud platform to manage your data, and now you have the foundation to leverage its power. As you continue your journey with Azure, explore additional features, such as Azure SQL Database Elastic Pool, to further enhance your database capabilities. Happy cloud data management!