gayankanishka / serverless-notifications

Serverless notification framework using Azure Functions.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serverless Notifications Using Azure Functions + Twilio + SendGrid

The solution implements a serverless notification framework. Azure functions are used to archive the serverless architecture. Twilio and sendgrid are used as the notification providers. Azure storages tables are used to store the application configurations. Azure Queue storage was used for internal communication of the functions. One single POST endpoint was provided to send out the notifications HINT: /api/notifications.

High-level architecture diagram

alt text

What's included:

Table of Content

Quick Start

After setting up your local DEV environment, you can clone this repository and run the solution. Make sure to configure the local.settings.json with the provided setting values. If you are using a Azure storage account replace AzureWebJobsStorage value with storage account connection string.

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
  }
}

Prerequisites

You'll need the following tools:

Development Environment Setup

First clone this repository locally.

  • Install all of the the prerequisite tools mentioned above.
  • Connect your Azure storage account into Azure storage explore link Or use default emulator storage account.
  • Create Configurations table in table storage
  • Add below Table storage configurations to the created table

alt text

Build and run from source

With Visual studio: Open up the solutions using Visual studio.

  • Restore solution nuget packages.
  • Rebuild solution once.
  • Run the solution.
  • POST Endpoint

Sample SMS notification request

{
  "body": "{\"Id\":\"ed32ef8d-1b19-40cc-915b-b8ff1b4d6ff0\",\"FromNumber\":null,\"ToNumber\":\"+NUMBER_WITH_COUNTRY_CODE\",\"MessageBody\":\"Hello there\"}",
  "notificationType": 1,
  "isScheduled": false,
  "scheduledDateTime": "2021-04-30T00:00:00"
}

License

Licensed under the MIT license.

About

Serverless notification framework using Azure Functions.

License:MIT License


Languages

Language:C# 100.0%