The ability to use a light-weight HTTP/S endpoint (called a webhook in this article) to access database tables removes the need to build a dedicated middle-tier application; the webhook becomes a form of a middle tier in itself. If you build a two-tier application, the webhook removes the need to use a client-side library to connect to the SQL Server, which means you can call SQL Server from any operating system exactly the same way.
Configuration
The SQL Server webhook is hosted by Enzo Online. In order to configure Enzo Online for webhook access to your database, you need to configure two components: a Connection String, and a SQL Server service. Creating the connection string is pretty straight forward; all you need is the Azure SQL Database connection string to your database.
Once the connection string has been created, you can then create a SQL Server service in Enzo Online as well, selecting the connection string you previously created. And you are pretty much configuring Enzo Online. You can now make SQL requests to your database using HTTP commands.
Trying the Webhook
In order to make HTTP calls to Enzo, you will need two pieces of information: the Enzo Instance URL, and the Enzo Auth Token. Both can be found in the Enzo Accounts menu.
Let’s test SQL Server access using Fiddler, a popular HTTP debugging tool. Start Fiddler and click on the Composer tab. Under the Parsed tab, enter the following information.
HTTP Type | GET |
URL | https://daas001.enzounified.com/bsc/sqlserver/run |
Headers | authToken: YOUR_ENZO_AUTH_TOKEN_config: azuredbsql: SELECT name FROM sys.tables |
Et voila… you will obtain a JSON response from Enzo Online of the result returned by your command. It is really that simple. Since you are getting back a JSON document you can easily parse the response regardless of the application programming language (node.js, C#, Python…).
In fact, you can pass all the parameters as an HTTP query, like this, and use your browser directly:
https://daas001.enzounified.com/bsc/sqlserver/run?_config=azuredb&sql=SELECT name FROM sys.tables&authToken=YOUR_AUTH_TOKEN
Accessing a SQL Server database hosted in the cloud using a webhook platform makes development much simpler since there is no need to build a middle tier service to access the database. Webhook based development can help with a large number of application development projects, including IoT and mobile development.