---
updatedAt: 2025-11-14T07:39:50.000Z
agentTools:
  projectIndex: https://docs.appery.io/llms.txt
---

# Microsoft Azure SQL Database

Connecting to Microsoft Azure SQL database.

This tutorial shows you how to create and configure an SQL cloud database for your Microsoft Azure account, construct firewall rules for it, and how to connect it with **[API Express](https://appery.io/apiexpress)**.

The first step is to create a Microsoft Azure account if you don't have one already.

# Creating *Microsoft Azure Account*

1. Open the link <https://portal.azure.com>. Log in with your account credentials; if you do not have it you will need to create one.
2. In order to create a cloud SQL database, on the left panel click **Create a resource > SQL Database**:

<Image align="center" border={true} src="https://files.readme.io/310eeba-2022-04-13_13-55-55.png" className="border" />

3. In the pop-up list, fill in the required fields with your parameters. Start with the **DB name**, then configure the required **Server settings**.
4. Click on **Create a new server** in the pop-up list and enter the new server name (you can also select an existing server). Add an admin login and password, then choose the server location. Finally, click ***OK***:

<Image align="center" border={true} src="https://files.readme.io/cdc29e1-2022-04-13_14-37-56.png" className="border" />

> 🚧 Server name
>
> Remember the full name of the server you have just created as you will need it later for configuring the Appery.io API Express database connection.

5. Proceed to the **Networking** tab.
6. Check the ***Public endpoint*** option in the **Network connectivity** section.
7. Select ***Yes*** for **Allow Azure services and resources to access this server**.
8. Select the ***TLS 1.2*** for the **Minimum TLS version** and go to the **Additional settings** tab:

<Image align="center" border={true} src="https://files.readme.io/1d12cee-2022-04-13_14-41-02.png" className="border" />

9. Select the ***Sample*** for the **Use existing data**.
10. Click the **Review + create** button:

<Image align="center" border={true} src="https://files.readme.io/57e6cbf-2022-04-13_14-44-12.png" className="border" />

11. Finally, confirm creating your SQL Database by clicking on the **Create** button.

# How to Configure *Firewall Rules*

1. Open the just created DB.
2. Note your **Server Name** (you can copy it to clipboarcd) as this will be used as the **Host**of your [database connection](https://docs.appery.io/docs/apiexpress-databaseconnection-microsoftazure-sql-database#creating-api-express-database-connection) and then click the **Set server firewall** button:

<Image align="center" border={true} src="https://files.readme.io/44bbecb-2022-04-13_15-12-21.png" className="border" />

3. Add firewall rules, using the IP addresses listed in the [Exposing Your Database to API Express](https://docs.appery.io/docs/apiexpress-database-connection#exposing-your-database-to-api-express) document:

<Image align="center" border={true} src="https://files.readme.io/2f779fd-2022-04-13_15-36-49.png" className="border" />

4. Save.

> 👍 Database created
>
> After a few minutes your rules will have been applied, and you will have successfully created/setup a Microsoft Azure SQL server and a SQL database in the Microsoft Manuals.

# Creating **API Express** *Database Connection*

1. Login to your [Appery.io](https://appery.io/) account.
2. In the **[Visual App Builder](https://docs.appery.io/docs/apperyio-visual-builder)**, go to the **[API Express](https://appery.io/apiexpress)** tab and click **Create new DB Connection**. Fill in all of the required information and enter the name.
3. In the next window, add your **Database connection name**, set the **Connection type** to ***Relational database***, then select the ***SGL Server*** as **Database Type**, and add the **Host**.

> 📘 Host
>
> The host value is the name you created above: ***your\_server\_name.database.windows.net***.

4. Define the **Port** = ***1433***, **Database Name**, **Username** and **password**. Those are for your Microsoft Azure SQL Database created [earlier](https://docs.appery.io/docs/apiexpress-databaseconnection-microsoftazure-sql-database#creating-microsoft-azure-account).
5. Click **Save**.
6. Define the ***ssl=request;sslProtocol=TLSv1.2*** for **Connection properties**.

> 📘 Ports
>
> ***1433*** is the default port for Microsoft Azure SQL DB Server.

7. To ensure that the **[API Express](https://appery.io/apiexpress)** connection can access your Microsoft Azure SQL database click **Test**, then **Save**:

<Image align="center" border={true} src="https://files.readme.io/008a637-2022-04-13_15-21-01.png" className="border" />