If you find any errors, typos or have general feedback, select the text and click CTRL+ALT+ENTER.

Microsoft Azure SQL database

Introduction

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 this with API Express.

Working with an Microsoft Azure Account

  1. Open the link https://portal.azure.com.Log in with your account credentials, if you do not have one you will need to create one.
  2. In order to create a cloud SQL database, on the left panel, click New > Data + Storage > SQL Database:SQL DB
  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 “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/password and choose the server location. Finally, click “OK”:
    NewServer-1

    Remember the full name of the server you have just created (for example, your_server_name.database.windows.net) – you will need it later for configuring the Appery.io API Express DB connection.

  5. To create and configure a database, click “Select source” and then check “Sample”:
    SelectSource-2
  6. After, click “Select sample” and choose AdventureWorksLT [V12], click “Create”. With in a few minutes, your server database will be created.
  7. To check that your new database was saved, click “All resources” (on the left-hand-side menu). You will see the created resources (SQL servers and SQL databases):Created-Resources-1

Configuring firewall rules

  1. To configure firewall rules for your database, select SQL server > Firewall and provide access for aex1.appery.io,aex2.appery.io, app5.appery.io and app6.appery.io nodes, using their IP addresses (not domain names).

    To find out the current actual IP addresses for nodes, you can use the command line tool nslookup (Windows, Linux, Mac OS X) or whois-like services from the Internet (like ping.eu, etc).

    Example response for nslookup looks as following:

  2. Add the required firewall rules for Appery.io API Express aex1.appery.io,aex2.appery.io, app5.appery.io and app6.appery.io nodes (one rule per save action is allowed), and click “Save”:
    Rules
  3. Wait for a few minutes for the rules to apply.

    You can find more information on how to create/setup Microsoft Azure SQL server and SQL database in Microsoft manuals (manual #2, manual #3).

Congratulations! Your have successfully configured your Microsoft Azure SQL database.

Creating an Appery.io DB connection

  1. Login with your account on https://appery.io.
  2. In the Appery.io Visual Builder, go to the API Express tab and click “Create new DB connection”, fill in all the required information and enter the name.
  3. In the next window, add your Database connection name, select SQL Server as Database type, and add Host (this is server name which you just created above, for example, your_server_name.database.windows.net
  4. Now, define the Port (1433 – this is the default port for Microsoft Azure SQL DB server), Database name, Username and Password for your Microsoft Azure SQL database created earlier (see above) and click “Save”.
  5. To ensure that the connection from the API Express can access your Microsoft Azure SQL database, click “Test”.

Google Cloud SQL database

Introduction

This tutorial shows you how to create and configure a cloud SQL database for your Google Cloud account, as well as how to gain access which enables you to control and connect it with API Express.

Working with Google Cloud Account

  1. Open the Google Developers Console and log in with the account credentials.
  2. To create an SQL cloud click on the “Products & services” menu on the left:
  3. In the pop-up list, select Storage > SQL and click “Create instance”.
  4. Now, select the required generation (in this example first generation is used, but you can choose it depending on your needs).
  5. Define the remaining parameters (Instance ID, Region, and Tier). In this example, the following parameters are used:
  6. Click “Create”. When finished, select the created instance to see the detailed information in it.
  7. By default, you are in the Overview tab. There are also Databases, Access Control, Replicas, and Operations tabs.

Adding and configuring Google Cloud database

  1. To create a new SQL database to be used with Appery.io API Express, open the Databases tab and click “New database”.
  2. Enter the database name and then click “Add”.
  3. Now, you can configure Access Control to your instance with the database. To do this, switch to the Access Control tab.
  4. In the new window, select the IP address option and click “Request IPv4 address” to be able to use it with API Express services:
  5. Then, switch to the Users tab and click “Create user account”.
  6. For security reasons, you are advised to restrict access for the created user by restricting hosts’ access. For its output requests, API Express uses following hosts:
    • aex1.appery.io
    • aex2.appery.io
    • app5.appery.io
    • app6.appery.io
  7. Create new user accounts to access your database with hosts restriction and add access for these hosts using their actual IP addresses (the actual IP can be different, see next step on how to determine it):
  8. To find out the current official IP addresses for nodes, you can use the command line tool nslookup (Windows, Linux, Mac OS X) or whois-like services from the Internet (like ping.eu, etc). Example response for nslookup looks as following:
  9. Now, go to the Authorization tab and add an authorized network under the corresponding panel by clicking “+ Add item”.
  10. Provide access for all nodes described in step 6 using the actual IP addresses (not domain names) – see above how to define them.
  11. Add the authorized networks and click “Save”.

You can find information on how to grant access to an external application in Google manuals.

Congratulations! Your have successfully configured your new Google Cloud SQL database.

Creating Appery.io DB connection

  1. Login with your account on https://appery.io.
  2. In the Appery.io builder, go to the API Express tab and click “Create new DB connection”, fill in all the required information and enter its name.
  3. In the next window, add your Database connection name, select MySQL as Database type, and add Host (IPv4 address attached to your Cloud SQL instance – see above).
  4. Now, define Port (3306 – the default MySQL port), Database name, Username and Password for your MySQL DB (Google Cloud account) created earlier (see above).
  5. Lastly, click “Save”.
  6. To ensure the connection from API Express services to your Google SQL Cloud works, click “Test”.