Summary
Add an event-driven webhook delivery system that lets customers register HTTP endpoints and receive signed event payloads when things happen in their SaaS subscription. Uses Azure Service Bus for reliable delivery and an Azure Function for processing/retries.
Includes a demo webhook receiver (Azure Function) that customers/publishers can deploy to test the full loop end-to-end.
Why
Customers building on top of FastSaaS need to react to events in their own systems — syncing with identity providers, triggering internal workflows, feeding BI pipelines, alerting their teams. Webhooks are the standard integration pattern (Stripe, GitHub, Twilio).
Event Types
Subscription lifecycle
subscription.activated — new subscription goes live
subscription.suspended — subscription paused
subscription.canceled — subscription ended
subscription.renewed — billing cycle renewed
plan.changed — customer changed plans
Seat/member changes
member.added — new member joined the tenant
member.removed — member removed from tenant
seat.limit.approaching — approaching seat cap (e.g., 80%)
Usage/metering
usage.threshold.reached — usage hit a configured threshold
usage.reported — metering event was recorded
Architecture
- Event producers — API services publish events to Azure Service Bus topics when actions occur (subscription changes, member updates, metering thresholds)
- Service Bus — Reliable message broker with per-tenant subscriptions and dead-letter support
- Azure Function — Processes messages from Service Bus, delivers HTTP POST to customer-configured endpoints with:
- HMAC-SHA256 signed payloads (shared secret per webhook)
- Retry with exponential backoff (3 attempts)
- Dead-letter after exhausted retries
- Webhook registry — Database table storing customer webhook configurations (URL, secret, subscribed event types, active/inactive)
- Delivery log — Track delivery attempts, status codes, failures per webhook
Customer Portal UI
The existing Webhooks page in the customer sidebar gets wired up:
- Register/edit/delete webhook endpoints
- Select which event types to subscribe to
- View delivery history (timestamp, event type, status code, success/failure)
- Test button to send a sample payload
- Rotate webhook signing secret
Publisher Portal UI
- View cross-tenant webhook delivery health (success rate, failure rate)
- See dead-lettered events
Demo Webhook Receiver
A ready-to-deploy Azure Function that acts as a sample webhook consumer for documentation and testing:
- HTTP-triggered Azure Function that receives webhook payloads
- Validates the HMAC-SHA256 signature against a configured secret
- Logs received events to Application Insights / console
- Returns the parsed event details in the response (for easy verification)
- Deployable via Bicep alongside the main infrastructure
- Documentation walkthrough: step-by-step guide to deploy the receiver, register it in the portal, trigger events (e.g., add a member), and see the payload arrive
- Can also serve as a template for customers building their own webhook consumers
Infrastructure
- Bicep templates for Service Bus namespace + topics + subscriptions
- Azure Function App for webhook delivery processor
- Azure Function App for demo webhook receiver
- Database migration for webhook_endpoints and webhook_delivery_log tables
Acceptance Criteria
Summary
Add an event-driven webhook delivery system that lets customers register HTTP endpoints and receive signed event payloads when things happen in their SaaS subscription. Uses Azure Service Bus for reliable delivery and an Azure Function for processing/retries.
Includes a demo webhook receiver (Azure Function) that customers/publishers can deploy to test the full loop end-to-end.
Why
Customers building on top of FastSaaS need to react to events in their own systems — syncing with identity providers, triggering internal workflows, feeding BI pipelines, alerting their teams. Webhooks are the standard integration pattern (Stripe, GitHub, Twilio).
Event Types
Subscription lifecycle
subscription.activated— new subscription goes livesubscription.suspended— subscription pausedsubscription.canceled— subscription endedsubscription.renewed— billing cycle renewedplan.changed— customer changed plansSeat/member changes
member.added— new member joined the tenantmember.removed— member removed from tenantseat.limit.approaching— approaching seat cap (e.g., 80%)Usage/metering
usage.threshold.reached— usage hit a configured thresholdusage.reported— metering event was recordedArchitecture
Customer Portal UI
The existing Webhooks page in the customer sidebar gets wired up:
Publisher Portal UI
Demo Webhook Receiver
A ready-to-deploy Azure Function that acts as a sample webhook consumer for documentation and testing:
Infrastructure
Acceptance Criteria