https://functions.azure.com/try
Monolithic
Frontend
Middle tier
Backend
Microservice
1
Microservice
2
Microservice
3
Microservice
4
Microservice
5
Function 1
Function 2
Function 3
Function 4
Function 5
Function 6
Function 7
Function 8
Function 9
Function 10
Function 11
Function 12
public static void Run(byte[] image, string filename,
Stream outputBlob, TraceWriter log)
{
log.Info($"Processing image: {filename}");
var imageBuilder = ImageResizer.ImageBuilder.Current;
imageBuilder.Build(
image, outputBlob,
new ResizeSettings(640, 400, FitMode.Max, null), false);
}
{
"bindings": [
{
"name": "image",
"type": "blobTrigger",
"direction": "in",
"path": "card-input/{filename}.jpg",
"connection": "AzureWebJobsStorage"
},
{
"type": "blob",
"name": "outputBlob",
"path": "card-output/{filename}.jpg",
"connection": "AzureWebJobsStorage",
"direction": "out"
}
]
}
{
"bindings": [
{
"name": "myQueueItem",
"type": "queueTrigger",
"direction": "in",
“queueName": "outputqueue",
"connection": "AzureWebJobsStorage"
},
{
"type": "blob",
"name": "outputBlob",
"path": "outblob/{rand-guid}.txt",
"connection": "AzureWebJobsStorage",
"direction": "out"
}
]
}
module.exports = function (context, myQueueItem, myOutputBlob) {
context.log('JavaScript queue trigger function ', myQueueItem);
//validate
if (myQueueItem.apiId && myQueueItem.method && myQueueItem.body)
{
const value = DoWork(myQueueItem);
if(value) {
context.bindings.myOutputBlob = JSON.stringify(value);
//myOutputBlob = JSON.stringify(value);
}
}
else {
//handle error queue item missing params
context.log('invalid queue item ', myQueueItem);
}
context.done();
}
https://flow.microsoft.com/
….and more!
Every 15 minutes Clean tableFind and clean invalid data
File added to
Blob Storage
Transform CSV to data rows Power BI
Chart graphic
Photo taken and
WebHook called Stores in blob storage Produces scaled images
Image Processing
Functions App 2
API
Function App 1
Photo taken and
WebHook called
Tasks/ Activities
• Upload data to
storage
• Process data
• Expose REST API
Using Functions
• Setup a VM/
Container/ WebJobs
• Build/ patch/ deploy
• Monitor infra
• Build Web API App
• ‘Use Azure SDK’
• Built async data
processing (scale)
Before Functions
• Setup a VM/
Container/ WebJobs
• Build/ patch/ deploy
• Monitor infra
• Build Web API App
• Use Azure SDK
• Built async data
processing (scale)
Photo taken and
WebHook called
Loaded web page
calls WebHook
Completed pageCreate ad based on user profile
Millions of devices feed
into Stream Analytics
Store data in
SQL Online
Transform to structured data
Infrastructure customization
EVENT SWARM ENGAGEMENT CHANNELS
FLEXIBLE BIG DATA PIPELINE
INTELLIGENCE PIPELINE
3RD PARTY
EVENT INGESTION
ENGINE
SQL DATA
WAREHOUSE
DATA LAKE STORAGE
& ANALYTICS
STREAM
ANALYTICS
WEB
CUSTOM
SERVICES
WEARABLES
POS
DIGITAL
DISPLAYS
BOTS
KIOSKS
MOBILE APP
SENSORS
OMNI CHANNEL ENGAGEMENT
WORKFLOW
ORCHESTRATION
ENTERPRISE INTEGRATION
CUSTOM INTELLIGENCE
INTELLIGENT
SERVICES
CUSTOM
FUNCTIONS
MACHINE
LEARNING
COGNITIVE
SERVICES
EXISTING
NEW
API GATEWAY
API GATEWAY
Tasks/ Activities
• Collect tweets
• Analyze tweets
• Display rich analysis
Using Serverless
• Setup a VM/
Container/ WebJobs
• Build/ patch/ deploy
• Monitor infra
• Connect (auth)to
twitter
• Using Twitter API
(SDK)
• Analyze tweets
• Build rich client to
show results
Before Serverless
• Setup a VM/
Container/ WebJobs
• Build/ patch/ deploy
• Monitor infra
• Connect (auth)to
twitter
• Using Twitter API
(SDK)
• Analyze tweets
• Build rich client to
show results
http://aka.ms/TryFunctions
https://aka.ms/func-github
https://github.com/yochay/serverlesspatterns
https://blogs.msdn.microsoft.com/appserviceteam/2017/07/06/alpha-preview-for-durable-functions/
https://azure.github.io/azure-functions-durable-extension/
F1 F2 F3 F4
F1 F2 F3 F4
TriggerFunc F1 F2 F3
• Azure Queues (SNS/ SQS) are an implementation detail.
• Each individual Function needs to be “aware” of other functions.
• Functions need to be idempotent.
• Functions need to “DoWork” and “UndoWork”
TriggerFunc F1 F2 F3
• Azure Queues (SNS/ SQS) are an implementation detail
• Central Error Handling Function “understand” the chain/flow
Error Handler
Heroes DoWork
GetStatus
Start DoWork
GetStatus
• Execution state
F1
F2
F1
F2 F2.1 F2.2
F1
F2
F3
State
https://github.com/yochay/serverlesspatterns
http://aka.ms/TryFunctions

[Serverless Meetup Tokyo #3] Serverless in Azure (Azure Functionsのアップデート、事例、デザインパターンなど (仮))