Logic App and Webhook

{tocify} $title={Table of Contents}


What is a Webhook? 

Technical Definition 

A webhook is a mechanism for automatically sending data from one system to another in real time when a specific event occurs. It does this using an HTTP POST request to a URL that’s been provided in advance (called a webhook endpoint). 

In short: A webhook is a "push" notification between systems via the web. 

 

Real-Life Analogy 

Imagine you're expecting a courier: 

  • Without a webhook: You keep checking the door every 5 minutes. 
  • With a webhook: The delivery person rings your doorbell the moment they arrive. 

That “doorbell” is the webhook — it pushes the event to you instead of making you keep checking. 

 

Polling vs Webhook 

Feature 

Polling 

Webhook 

Action 

Keep asking: “Anything new?” 

You're told: “Here’s the new data!” 

Performance 

Repetitive, delayed 

Instant, efficient 

Efficiency 

Wastes resources on repeated checks 

Lightweight & real-time 

Response time 

Delayed, depends on check frequency 

Immediate 

Example 

Checking email every minute manually 

Getting an email notification 

 


When NOT to Use a Webhook 

  • When you need to pull large datasets on demand  (Use an API with pagination or batch processing) 
  • When the event source doesn’t support webhooks (Use polling or other integrations) 
  • For mission-critical delivery without retry/failure handling(You’ll need to add retry logic or queueing in case the webhook fails) 

Using Azure Logic Apps with Webhooks 

Azure Logic Apps can be used both as a webhook receiver and as a webhook sender. 

 

Part 1: Logic App as a Webhook Receiver 

You can receive data from external systems like Stripe, GitHub, or custom apps. 

Steps to Make Logic App a Webhook Listener: 

  1. Create a Logic App. 
  2. Select “When an HTTP request is received” as the trigger. 
  3. Define the expected JSON schema (or use sample payload). 
  4. Add actions (e.g., save to database, send email). 
  5. Save it → Azure generates a webhook URL. 
  6. Copy this URL and paste it in the external system’s webhook configuration. 

Now, whenever that system triggers the event, it sends a POST request to your Logic App, starting the workflow. 

 

Part 2: Logic App as a Webhook Sender 

You can use Logic Apps to send webhook events to other systems that expose a webhook endpoint (like Microsoft Teams, Slack, Discord, Jira, custom APIs, etc.). 

 

Example: Logic App Sends Webhook to Custom API 


HTTP Action Configuration: 

Method: POST 
URI: https://api.mycompany.com/receiveOrder 
Headers: 
  Content-Type: application/json 
Body: 
{ 
  "orderId": "@{triggerBody()?['OrderId']}", 
  "customer": "@{triggerBody()?['CustomerName']}", 
  "total": "@{triggerBody()?['Amount']}" 
} 
  

This turns your Logic App into a webhook sender — notifying your downstream system as soon as the event happens. 

 

 

 

Securing Webhook Communication 

1.Receiver (Logic App): 
  • Validate request signatures 
  • Add firewall or IP restrictions 
  • Use Azure API Management for control 
2.Sender (Logic App): 

  • Send secure headers or tokens 
  • Ensure HTTPS only 



Summary 

Logic App and webhook



Role 

How Logic App Works 

As Receiver 

Uses “When an HTTP request is received” trigger 

As Sender 

Uses HTTP POST action to call other webhooks 

Key Benefit 

Real-time automation with little/no code 

Use Cases 

Payments, alerts, syncs, updates, notifications 

 

 










Post a Comment

If you have any suggestions or questions or want to share something then please drop a comment

Previous Post Next Post