What email address or phone number would you like to use to sign in to Docs.com?
If you already have an account that you use with Office or other Microsoft services, enter it here.
Or sign in with:
Signing in allows you to download and like content, and it provides the authors analytical data about your interactions with their content.
Embed code for: Serverless Patterns with Azure Functions (Azure Functionsでのサーバーレス パターン)
Select a size
Serverless Patterns with Azure Functions (Azure Functionsでのサーバーレス パターン)
ServerlessConf Tokyo (2016/10/01)
Serverless Patterns with Azure Functions (Azure Functions でのサーバーレス パターン)
Naoki Sato , Tsuyoshi Ushio, Kazuyuki Nomura
Technical Evangelists, Microsoft
ServerlessConf Tokyo (Oct 01 2016) #serverlessconf
Naoki Sato | @satonaoki
Azure Technical Evangelist
Formerly Java & Middleware Technical Evangelist at Oracle
Joined Microsoft in 2010
Global member for DX Azure Incubation Team (2010-2015)
Focus on Azure, especially Application Platform, Data Analytics and ML/DL
Supervisor/translator of many books from O’Reilly and others
S/N Ratio (Blog)
さとうなおきの「週刊 Azureなう」 (ZDNet Japan)
Tsuyoshi Ushio | @sandayuu
DevOps Senior Technical Evangelist
15+ DevOps/Agile Consultant / Coach
Community organizer of Tech / English
Book : How to obtain an OO brain. (Japanese)
Working in IT since 1994, MSFT since 2015
Global member for DX DevOps Technical Working Group
Frequent speaker at conferences include international conference
Live DevOps in Japan
Blog、 DevOps Interview (JP, EN) Channel 9 Movie (JP, EN) メソッド屋のブログ （生産性と文化）
Before cloud - B.Y.O. Servers
A wild IaaS appears…
What is “serverless”
Abstraction of servers
How is it different
Inside client app
Loosely coupled components
Outside client app
Benefits of “serverless”
Ease of scale
How does this change how we think about building applications?
Instead of implementing a route inside of a Web Application server, I write a function.
Instead of writing large functional tests against a server, your functional tests look more like unit tests per function.
Instead of building and deploying servers, I deploy collections of Functions
General practices for serverless
Thick clients; thin & stateless backends
SPAs like Angular/React are your friend
Be sure to enable CORS
Sync is nice, but Async is nicer
Async, queue based systems are more resilient
Read and internalize the reactive manifesto -
While synchronous work will happen, minimize the work done in a sync function and kick off to a queue based async process (HTTP status code 202, not 201 )
Live and die by the cloud
Like never before, develop on the cloud, test on the cloud, ship on the cloud
Not just FaaS, but use other serverless tech that best solves the problem (like Logic Apps)
Key benefits of Azure Functions
Azure Application Platform
Build on a Developer Platform (PaaS)
Web, mobile, API, and logic apps
Cloud native, microservices based apps
Serverless, event driven functions
Custom monolithic 3-tier stateless apps
Cloud Foundry, OpenShift, Apprenda, Jetlastic, etc.
Build on the OS (IaaS)
Web and mobile
Virtual Machines and Containers
Process events with Serverless code.
Events + data
Make composing Cloud Apps insanely easy
Develop Functions in C#, Node.js, F#, Python, PHP, Batch and more
Easily schedule event-driven tasks across services
Expose Functions as HTTP API endpoints
Scale Functions based on customer demand
Easily integrate with Logic Apps
Azure Functions architecture
Built on top of App Service and WebJobs SDK
Language Runtime C#, Node.js, F#, PHP, etc.
WebJobs Script Runtime Azure Functions Host – Dynamic Compilation, Language abstractions, etc.
Programming model, common abstractions
Triggers, input and output bindings
App Service Dynamic Runtime Hosting, CI, Deployment Slots, Remote Debugging, etc.
Serverless compute abstracts away the compute
Bindings abstract away the services you interact with
Functions programming concepts
| - host.json
| - mynodefunction
| | - function.json
| | - index.js
| | - node_modules
| | | - ... packages ...
| | - package.json
| - mycsharpfunction
| | - run.csx
What is the “Functions” programming model?
Function as the unit of work
Functions are executed; they start and finish
Functions have inputs and outputs
Azure Functions Demo
Platform and scaling
App Service offers dedicated and dynamic tiers.
Dedicated is the existing App Service plan tiers
Basic, Standard, Premium
Pay based on # of reserved VMs
You’re responsible for scale
Pay on number of executions
Platform responsible for scale
Dynamic tier pricing
Pay per execution model - two meters, three units
Number of executions
Duration of execution x reserved memory
Best practices for the “Functions” programming model
Functions should “do one thing”
Functions should be idempotent
Functions should finish as quickly as possible
Functions architecture patterns are often microservices patterns
Lots of smaller services
Independent deployment units
Inter-service versioning becomes very important
Use async messages between Functions, not sync http requests
Scaling and runtime best practices
E2E perf testing is still in fashion
Just because you’re not building services doesn’t mean there isn’t limits to the service
Each workload is a unique combination of resource consumption, it’s hard to know what the scale is ahead of time – working on providing some “ceilings”
Reduce, reuse, recycle (resources)
Functions in a Function App share memory
A singleton can be shared across many Functions – database connection pooling is possible, ditto for redis caches
Be careful of what you load – memory is averaged over your Functions
Get rid of data/objects you don’t need
Scaling and runtime best practices (cont’d)
Disk is a network drive – shared across functions
Avoid disk access for perf critical work
Disk can be used between different instances
It’s just App Service
Kudu, etc. work fine, use them.
Use recommended guidance for App Service, where applicable
Putting it into action
Suggestions for getting started
For existing services, start small. Replace 1 API or background processing item.
Integration is a great place to introduce serverless, because it is often a new layer on top of old layers.
Have fun with it – build something that makes your life easier that wouldn’t normally justify buying a whole server for
Signs that a serverless pattern might be useful for a given scenario
Not worth deploying a traditional backend
Workload is sporadic (very low & high scale)
“DevOps” favored over dedicated ops
Lots of different services involved that need “glue”
Example: Timer based processing
y 15 minutes
Find and clean invalid data
Example: Azure service event processing
File added to
m CSV to data
Interactive IchaIcha Analysis
Game Development Genius Fujimoto
Analyze sad people’s tendency
Add photo to Blob storage
Store to SQL Database
Example: SaaS event processing
Excel file saved
t Graph API analyzes content
eates new sheets
Twitter, Sentiment Analysis and Slack using Azure Functions, Azure Logic Apps & Microsoft Cognitive Services
Azure Logic Apps
Develop and deliver powerful integration solutions with ease
Create business processes and workflows visually
Deliver integration capabilities in web, mobile, and API apps
Integrate with your SaaS and enterprise applications
Automate EAI, B2B, and business processes
Connect to on-premises data
The grow-up story for Microsoft Flow
Integrated with BizTalk server on-prem
Visual designer based on declarative language
Stock library of SaaS and format connectors
Leverage Azure Functions as custom steps
Invoke with a timer and web hooks
Microsoft Cognitive Services preview
Computer Vision | Emotion | Face | Video
Custom Recognition | Speaker Recognition Speech
Give your solutions a human side
Bing Spell Check | Language Understanding Linguistic Analysis | Text Analytics | Web Language Model
Academic Knowledge | Entity Linking Knowledge Exploration | Recommendations
Bing Auto Suggest | Bing Image Search | Bing News Search Bing Video Search | Bing Web Search
Why Microsoft Cognitive Services?
Roll your own with REST APIs
Simple to add: just a few lines of code required
Integrate into the language and platform of your choice
Breadth of offerings helps you find the right API for your app
Built by experts in their field from Microsoft Research, Bing, and Azure Machine Learning
Quality documentation, sample code, and community support
GET A KEY
Sentiment analysis Understand if a record has positive or negative sentiment
Key phrase extraction Extract key phrases from a piece of text, and retrieve topics
Topic detection Use clustering techniques to identify the trending topics on a large set of text records
Language detection Identify the language, 120 supported languages
Twitter, Sentiment Analysis and Slack
1 分ごとにTwitter をキーワード検索
Text Analytics API (Cognitive Services)
Azure Functions & Azure Logic Apps
Example: Serverless Web Applications architectures
Loaded web page
eate ad based on user p
Async background processing
Example: Serverless Mobile back ends
Photo taken and
es in blob storage
oduces scaled images
Example: Real-time stream processing
f devices feed
m to structu
e data in
Example: Real-time bot messaging
tana Analytics answe
Example: Invoice Processing
Convert to JSON
Post new invoice
Grab raw file
Get started and reach out!
Try Functions –
Try App Service –
Microservices x DevOps が必要なら!
Azure x 自動化ハックフェストご提供
Value Stream Mapping
マイクロソフトの DevOps 世界事例 + on Azure なら、無料で VSMとハックフェストをご提供
ブースで Serverlessと Azureデモが見れる !
インフラエンジニア、アーキテクト、 IT 戦略立案に関わる皆様を対象に
2016 年 11 月 1 日 ( 火) – 11 月 2 日 ( 水)
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
It’s all you - your hardware, your VMs, your application servers, etc.
No longer have to go to the store to get a VM - it’s just available for you
But the question becomes, why do I need to set up my VM? I just need to host this app?
Break up the lowest unit into simple config and code. The smallest possible piece of work is done by each piece.
Why is this impactful???
Abstraction of servers, infrastructure and configuration of operating system
Mono-lithic application -> loosely coupled components
Events happening async outside client application
Build/use micro-functionality to react to a single event
“Pinnacle of PaaS compute”
Not just hardware “servers”, but software servers are also managed for you
Focus on business logic, not solving technical problems not core to business
Lower effort to get started makes it easier to experiment (bots, etc.)
[The 1,000ft View - PaaS services drill down]
Define what constitutes the Azure application platform. What are the main services developers need to think about.
Key talking points:
Build on the OS: Virtual Machines are the “base unit” for moving workloads to the cloud. The Azure Container Service provides a really fast way to get containers into production with a choice of popular open source container orchestration solutions: DC/OS or Docker Swarm
App Service: is a set of services that has everything you need to build apps that target both web and mobile clients from a single app back end. Supporting a range of language options—.NET, Node.js, Java, PHP, and Python—it consists of Web Apps, Mobile Apps, Logic Apps, and API Apps.
Service Fabric: is a platform that developers and ISVs can use to build and manage custom microservice-based applications at cloud scale and with 24x7 availability. Microservices are an architectural approach based on fine-grained, loosely coupled services that can enable advanced developer agility
Functions: provides serverless, compute for event-driven solutions that extends the existing Azure application platform with capabilities to implement code triggered by events occurring in other Azure services, SaaS products (like Office365 and Salesforce.com), and on-premises systems.
Cloud Services: was the original Microsoft platform as a service (PaaS) service launched in 2010. Inspired by the needs of developers, Cloud Services enabled them to easily deploy .NET applications, taking advantage of cloud infrastructure like Virtual Machines and Virtual Networks without having to manage the low-level details and configuration of Windows Server and the underlying infrastructure.
Other PaaS: all PaaS runs great on Azure! Azure supports the leading third-party PaaS framework providers like Cloud Foundry and OpenShift.
Working on open sourcing our load generator for customers to make use of
Microsoft Build 2016
At Microsoft, we’ve been offering APIs for a very long time across the company. In delivering Microsoft Cognitive Services API, we started with 4 last year at /build (2015); added 7 more last December, and today we have 22 APIs in our collection.
Cognitive Services are available individually or as a part of the Cortana Intelligence Suite, formerly known as Cortana Analytics, which provides a comprehensive collection of services powered by cutting-edge research into machine learning, perception, analytics and social bots.
These APIs are powered by Microsoft Azure.
Developers and businesses can use this suite of services and tools to create apps that learn about our world and interact with people and customers in personalized, intelligent ways.
Why choose these APIs? They work, and it’s easy.
Easy: The APIs are easy to implement because of the simple REST calls. Being REST APIs, there’s a common way to implement and you can get started with all of them for free simply by going to one place, one website, www.microsoft.com/cognitive. (You don’t have to hunt around to different places.)
Flexible: We’ve got a breadth of intelligence and knowledge APIs so developers will be able to find what intelligence feature they need; and importantly, they all work on whatever language, framework, or platform developers choose. So, devs can integrated into their apps—iOS, Android, Windows—using their own tools they know and love (such as python or node.js, etc.).
Tested: Tap into an ever-growing collection of powerful AI algorithms developed by experts. Developers can trust the quality and expertise build into each API by experts in their field from Microsoft’s Research organization, Bing, and Azure machine learning and these capabilities are used across many Microsoft first party products such as Cortana, Bing and Skype.
Understanding and analyzing unstructured text is an increasingly popular field and includes a wide spectrum of problems such as sentiment analysis, key phrase extraction, topic modeling/extraction, aspect extraction and more.
© 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.form with capabilities to implement code triggered by events occurring in other Azure services, SaaS products (like Office365 and Salesforce.com), and on-premises systems.
Cognitive Services are available individually or as a part of the Cortana Intelligence Suite, formerly known as Cortana Analytics, which provides a comprehensive collection of services powered by cutting-edge research into machine learning, perception,