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.
The first step is to create a Microsoft Azure account if you don't have one already.
- 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.
- In order to create a cloud SQL database, on the left panel click Create a resource > SQL Database:
- In the pop-up list, fill in the required fields with your parameters. Start with the DB name, then configure the required Server settings.
- 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:
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.
- Proceed to the Networking tab.
- Check the Public endpoint option in the Network connectivity section.
- Select Yes for Allow Azure services and resources to access this server.
- Select the TLS 1.0 for the Minimum TLS version and go to the Additional settings tab:
- Select the Sample for the Use existing data.
- Click the Review + create button:
- Finally, confirm creating your SQL Database by clicking on the Create button.
- Open the just created DB.
- Note your Server Name (you can copy it to clipboarcd) as this will be used as the Hostof your database connection and then click the Set server firewall button:
- Add firewall rules, using the IP addresses listed in the Exposing Your Database to API Express document:
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.
- Login to your Appery.io account.
- In the Visual App Builder, go to the API Express tab and click Create new DB Connection. Fill in all of the required information and enter the name.
- 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.
The host value is the name you created above: your_server_name.database.windows.net.
- Define the Port = 1433, Database Name, Username and password. Those are for your Microsoft Azure SQL Database created earlier.
- Click Save.
- Define the ssl=request;sslProtocol=TLSv1.0 for Connection properties.
1433 is the default port for Microsoft Azure SQL DB Server.
- To ensure that the API Express connection can access your Microsoft Azure SQL database click Test, then Save:
Updated 3 months ago