Wassim Chegham PRO
Senior Developer Advocate @Microsoft ★ Angular contributor ★ Bazel contributor ★ GDE @Google ★ creator of @itsjustangular / hueaction.dev / ngx.tools / xlayers.dev / angular.run / thundr.dev
by Wassim Chegham — @manekinekko
ONCE UPON A TIME...
NOW, TELL ME...
Serverless architectures are application designs that incorporate third-party “Backend as a Service” (BaaS) services, and/or that include custom code run in managed, ephemeral containers on a “Functions as a Service” (FaaS) platform.
Microsoft
Sr. Developer Advocate (JavaScript)
WassimChegham
https://wassim.dev
More at wassim.dev
Angular GDE (core team alumni.)
Bazel Web Team contributor
GDE for the Google Assistant
Angular Universal (original core team alumni.)
GDE for GCP (alumni.)
Auth0 Ambassador
Member of the Node.js org. (OpenJS Foundation)
NestJS contributor
Compodoc core team
The delivery of computing services—including servers, storage, databases, networking, software, analytics, and intelligence—over the Internet (“the cloud”) to offer faster innovation, flexible resources, and economies of scale.
Network
Storage
Servers
Virtualization
OS
Middleware
Runtime
Database
Application
Network
Storage
Servers
Virtualization
OS
Middleware
Runtime
Database
Application
Network
Storage
Servers
Virtualization
OS
Middleware
Runtime
Database
Application
Network
Storage
Servers
Virtualization
OS
Middleware
Runtime
Database
Application
On Premise
IAAS
PAAS
SAAS
Network
Storage
Servers
Virtualization
OS
Middleware
Runtime
Database
Application
FAAS
Managed by you
Managed by the Cloud Provider
Functions
Functions
Functions
Functions
Event Grid
Functions
Logic Apps
Manage all events that can trigger code of logic
Database
Storage
Execute your code based on events you specify
Analytics
Intelligence
Design workflows and orchestrate processes
Security
IoT
Serverless messaging
Serverless compute
Serverless workflow
Also: CI/CD for serverless, Serverless Kubernetes, Cognitive computing, SQL Database...
** More Runtimes will be supported
Type | Trigger | Input | Output |
---|---|---|---|
Blob Storage | ✔ | ✔ | ✔ |
Cosmos DB | ✔ | ✔ | ✔ |
Event Grid | ✔ | ||
Event Hubs | ✔ | ✔ | |
HTTP & Webhooks | ✔ | ✔ | |
Microsoft Graph Excel tables | ✔ | ✔ | |
Microsoft Graph OneDrive files | ✔ | ✔ | |
Microsoft Graph Outlook email | ✔ | ||
Microsoft Graph Events | ✔ | ✔ | ✔ |
Microsoft Graph Auth tokens | ✔ | ||
Mobile Apps | ✔ | ✔ | |
Notification Hubs | ✔ | ||
Queue storage | ✔ | ✔ | |
SendGrid | ✔ | ||
Service Bus | ✔ | ✔ | |
SignalR | ✔ | ✔ | |
Table storage | ✔ | ✔ | |
Timer | ✔ | ||
Twilio | ✔ |
Create Your 1st Function: VS Code
Create Your 1st Function: VS Code
Create Your 1st Function: AZURE CLI
func init myFunProject --javascript
func new --name myfun \
--template "HttpTrigger" \
--language javascript
func host start
curl http://localhost:7071/api/myfun
Example: "httpTrigger" Function
module.exports = async (context, req) => {
context.done(null, {
res: 'Hello World :)'
});
};
{
"bindings": [{
"type": "httpTrigger",
"direction": "in", "name": "req"
}, {
"type": "http",
"direction": "out", "name": "$return"
}]
}
Deploy Your Function: You Choose.
$ npm install -g ngrok
$ ngrok http 7071
$ npm install -g localtunnel
$ lt --port 7071
TIP: Expose Your Local Function.
** Remember to stop the tunnel when you're done!!
$ npm install -g artillery
$ artillery quick -d 300 -r 30 \
https://<app_name>.azurewebsites.net/api/myfun
TIP: Harness Your Function.
1. Request Auth link (Angular)
2. Generate Auth link (Function)
3. Connect to Philips HUE account
4. Register account (Function)
5. Store session (Cosmos BD)
6. Trigger action (Function)
7. Revoke account (Function)
Control PHILIPS HUE Lights (hueaction.dev).
1. Capture image (Angular)
2. Upload the image (Storage)
3. Extract text (Vision API)
4. Translate it (Translate API)
5. Store result (Table)
6. Read the result (Queue)
7. Send SMS (TWILIO)
Extract and Translate text + send SMS.
By Wassim Chegham
Azure Functions is a serverless compute service that enables you to run code on-demand without having to explicitly provision or manage infrastructure. Use Azure Functions to run a script or piece of code in response to a variety of events. Learn how to use Azure Functions with our quickstarts, tutorials, and samples 👉http://bit.ly/2NJHRIW
Senior Developer Advocate @Microsoft ★ Angular contributor ★ Bazel contributor ★ GDE @Google ★ creator of @itsjustangular / hueaction.dev / ngx.tools / xlayers.dev / angular.run / thundr.dev