Many are using relational databases, the JDBC Connector for Logic Apps (Standard) allows to establish a connection with most relational databases and perform actions. We are exploring here, step-by-step, how to create an Azure PostgreSQL, configure the connection with all the requirements, then call a function and use the response in the body of an email to be sent.
Here is a step-by-step for creating the PostgreSQL in Azure, configuring the connection and other requirements, then creating the Logic App (Standard) workflow, add the actions, and test a function, finally parse the response and send it by email.
Create a PostgreSQL on Azure, search for PostgreSQL in the search box in Azure Portal, then select “Azure Database for PostgreSQL”, the cost will depend on the VM resources you select.
Once you create the server, browse to the Connection strings and copy the one for JDBC, this will be used later.
I downloaded the pgAdmin to be able to create the database, tables, enter some data, and create the function that we will be calling: PostgreSQL: File Browser
I changed the below settings, as I was able to connect from pgAdmin using the Certificate, but not from Logic Apps.
As the response is inside an array, I can either put the Send an email action in a for-each or just get the first item (this will throw an error if there is no items in the response of the previous action).
Now will test the workflow again, and receive an email with the data.
Thank you :)
*PostgreSQL and JDBC logos are sole property of their respective owners.