Functions

from A to Z

Azure

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.

โ€” Martin Fowler

Microsoft

Sr. Developer Advocate

WassimChegham

Klingon

(author)

xLayers.dev

(author)

Angular tooling Team

Compodoc

(co-author)

Universal

(former member)

ngx.tools

(author)

Google Cloud

Actions On Google

Angular

GDEโ€“nominated by GOOGLE

Benefits of Serverless.

shorter time to market.

Efficiency,

Variable costs.

Less waste.

Better service stability.

Easier pivoting.

Flexibility,

Easier experimentation.

microservices.

Scale at your own pace.

Focus on code.

No infrastructure.

Auto-scale.

pay AS YOU GO.

FOR SHORT,

Serverless on Azure.

IDE Support

Integrated DevOps

Local Development

Monitoring

Visual Debug History

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

=

DISCLAIMER:

FAAS + BAAS

Let's talk about Azure Functions.

Fully Managed

Event Oriented

Scalable

sandboxed

choose your runtime

generally available

** More Runtimes will be supported

experimental

ย 
ย 

SUPPORTED Triggers

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 โœ”

SUPPORTED BINDINGS

developer experience

Create Your 1st Function: VS Code

Create Your 1st Function: VS Code

Create Your 1st Function: AZURE CLI

func init myFunProject
func new --name myfun --template "HttpTrigger"
func host start
curl http://<ip_address>: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.

External package URL

Zip deploy

docker container

web deploy

source control

local git

cloud sync

ftp

portal

$ 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.

LOGGING STRATEGY.

DNS OPTIMISATIONS.

RUNTIME VERSIONS.

ROLLBACK STRATEGIES.

gotchas!!

demo time

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)

resources & links

that's all, folks!

@manekinekko

ย 
ย 

Azure Functions from A to Z

By Wassim Chegham

Azure Functions from A to Z

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

  • 1,488
Loading comments...

More from Wassim Chegham