Logic App – Insert data into On-Prem SQL Server

To create a Consumption Logic App in Azure named ‘la-test-sql-02’ that uses an HTTP trigger with a POST method to insert data into an on-premises Microsoft SQL Server table.

Step-by-Step Guide

  1. Create the Logic App:
    • In the Azure Portal, navigate to Logic Apps and click Add.
    • Fill in the details, name the app la-test-sql-02, and choose the Consumption plan.
    • Click Create.
  2. Add HTTP Trigger:
    • Open your Logic App in the Logic App Designer.
    • In the Logic App Designer, search for HTTP and select the When_a_HTTP_request_is_received trigger.
    • Set the Method to POST.
  3. Set up On-premises Data Gateway:
  4. Add SQL Action:
    • After setting up On-Prem Data Gateway, click on New step and search for SQL Server.
    • Choose Insert row (V2).
    • Connect to your on-premises SQL Server using the Data Gateway.
  5. Save and Test:
    • Save your Logic App.
    • Use a tool like Postman to send a POST request to the HTTP trigger URL with the JSON payload.
Here's how your Logic App should look:
estudy247-la-test-sql-02

HTTP Request Payload

{
"id": "123",
"name": "Estudy247",
"email": "estudy24by7@gmail.com"
}

You can download the logic app template from the estudy247 GitHub repository– la-test-http-02

Post a comment

Leave a Comment

Scroll to Top