Real-Time Event-Driven

webhooks.ms

The complete guide to Microsoft Webhooks โ€” connect services, automate workflows, and build event-driven integrations across Teams, SharePoint, Azure & beyond.

scroll

The Webhook Flow

A webhook is a user-defined HTTP callback. When an event occurs, the source makes an HTTP POST to the registered URL โ€” delivering real-time data with zero polling.

๐ŸŽฏ

Event Occurs

A change happens in the source system (new message, file update, build completes).

โ†’
๐Ÿ“ก

HTTP POST Sent

The source sends a JSON payload to your registered webhook endpoint URL.

โ†’
๐Ÿ”

Auth Verified

Your endpoint verifies the request via HMAC signature, header key, or query string.

โ†’
โš™๏ธ

Action Triggered

Your service processes the payload โ€” logging, alerting, transforming, or forwarding data.

Webhooks Across Services

Microsoft supports webhooks across its entire cloud ecosystem. Each service has its own webhook capabilities and patterns.

๐Ÿ’ฌ

Microsoft Teams

Incoming Webhooks post messages with Adaptive Cards to channels. Outgoing Webhooks let users @mention a service and get real-time responses within 10 seconds.

IncomingOutgoingAdaptive CardsJSON Payload
๐Ÿ“

SharePoint Online

Subscribe to list and library changes with SharePoint webhooks. Notifications include the subscription ID, resource URL, and tenant ID โ€” use GetChanges API for details.

List ChangesSubscriptionsDelta SyncREST API
๐Ÿ”ง

Azure DevOps

Service hooks send JSON event payloads for work items, builds, releases, code pushes, and pull requests. Supports HTTPS endpoints with filtering and basic auth.

Service HooksCI/CDWork ItemsGit Events
โšก

Power Apps / Dataverse

Register webhooks as service endpoints to receive server event data. Supports HttpHeader, WebhookKey, and HttpQueryString authentication with 60-second timeouts.

Plug-in StepsEntity EventsHMAC AuthAzure Functions
โ˜๏ธ

Azure Automation

Trigger runbooks via webhook URLs for maintenance events, VM management, and scheduled tasks. Integrates with Event Grid for pre/post maintenance workflows.

RunbooksEvent GridPre/Post EventsPowerShell
๐Ÿ”ฎ

Microsoft Graph

Subscribe to change notifications for users, messages, calendar events, drive items, and more. Uses delta queries for efficient state synchronization across tenants.

SubscriptionsChange NotificationsDelta QueryOAuth 2.0

Webhook Tester

Simulate sending webhook payloads and see the response in real-time. Edit the JSON, choose a scenario, and fire away.

Live Tester

Request Payload
Response
WAITING
Awaiting webhook request...

Code Examples

Get started with webhooks in your language of choice. Copy, paste, and deploy.

# Send a message to Teams via Incoming Webhook curl -X POST "https://your-org.webhook.office.com/webhook/..." \ -H "Content-Type: application/json" \ -d '{ "type": "message", "attachments": [{ "contentType": "application/vnd.microsoft.card.adaptive", "content": { "type": "AdaptiveCard", "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.4", "body": [{ "type": "TextBlock", "text": "Build #142 deployed โœ…", "weight": "Bolder", "size": "Medium" }] } }] }'
// Receive & verify a webhook in Express const express = require('express'); const crypto = require('crypto'); const app = express(); app.use(express.json()); app.post('/api/webhook', (req, res) => { const signature = req.headers['x-hub-signature']; const hash = crypto .createHmac('sha256', process.env.WEBHOOK_SECRET) .update(JSON.stringify(req.body)) .digest('hex'); if (signature === `sha256=${hash}`) { console.log('โœ… Verified:', req.body); res.status(200).send('OK'); } else { res.status(403).send('Invalid signature'); } }); app.listen(3000);
# Flask webhook receiver with HMAC verification import hmac, hashlib, json from flask import Flask, request, jsonify app = Flask(__name__) SECRET = "your-webhook-secret" @app.route("/api/webhook", methods=["POST"]) def handle_webhook(): signature = request.headers.get("X-Hub-Signature") payload = request.get_data() expected = "sha256=" + hmac.new( SECRET.encode(), payload, hashlib.sha256 ).hexdigest() if hmac.compare_digest(signature, expected): data = json.loads(payload) print("โœ… Verified:", data) return jsonify({"status": "ok"}), 200 return jsonify({"error": "forbidden"}), 403
// ASP.NET Core webhook controller [ApiController] [Route("api/[controller]")] public class WebhookController : ControllerBase { [HttpPost] public async Task<IActionResult> Receive() { using var reader = new StreamReader(Request.Body); var body = await reader.ReadToEndAsync(); var secret = Configuration["WebhookSecret"]; var signature = Request.Headers["X-Hub-Signature"]; var hash = ComputeHmac(body, secret); if (signature == $"sha256={hash}") { var payload = JsonSerializer.Deserialize<object>(body); _logger.LogInformation("โœ… Webhook verified"); return Ok(); } return Forbid(); } }

Webhook Fundamentals

Essential patterns and best practices when working with Microsoft webhooks.

๐Ÿ”

Retry Logic

Implement exponential backoff. Microsoft services retry failed deliveries โ€” return 2xx quickly to confirm receipt.

๐Ÿ”’

HMAC Verification

Always validate the signature header using a shared secret to ensure the payload is from a trusted source.

โฑ๏ธ

Timeout Handling

Most Microsoft services enforce a 60-second timeout. Process webhooks async โ€” acknowledge first, process later.

๐Ÿ“ฆ

Payload Size

Teams limits messages to 28KB. Dataverse strips properties when payloads exceed 256KB. Design compact payloads.

๐Ÿšฆ

Rate Limiting

Teams throttles at 4 requests/second per connector. Azure DevOps may batch notifications. Monitor HTTP 429 responses.

๐Ÿ”—

Idempotency

Webhooks may be delivered more than once. Use unique event IDs to deduplicate and ensure safe reprocessing.

๐Ÿ“‹

Subscription Management

SharePoint and Graph subscriptions expire. Implement renewal logic before expiration to maintain continuity.

๐ŸŒ

HTTPS Only

All Microsoft webhook endpoints must use HTTPS. HTTP endpoints will be rejected to prevent data leakage.

Event Log

Real-time log of webhook activity from the tester above.

Webhook Events
--:--:-- SYS Webhook tester initialized. Ready to receive events. READY