24. Runtime, Bindings, CLI, developer portal, templates & samples
https://github.com/Azure/Azure-Functions
Open roadmap
Runtime is intended to be portable
25. Example: Timer based processing
Every 15 minutes Clean tableFind and clean invalid data
26. Example: Azure service event processing
File added to
Blob Storage
Transform CSV to data rows
CSV
Power BI
Chart graphic
27. Example: Serverless Mobile back ends
Photo taken and
WebHook called Stores in blob storage Produces scaled images
31. Vision Speech Language Knowledge Search Labs
Computer Vision Speech Spell Check Academic Knowledge Autosuggest Prague
Content Moderator Speaker Recognition Web Language Model Knowledge Exploration Web Search Johannesburg
Face Translator Speech Text Analytics Entity Linking Service Image Search Abu Dhabi
Emotion Linguistic Analysis QnA Maker Video Search Nanjing
Video Translator Text Recommendations News Search Cuzco
Video Indexer Wollongong
Custom
Vision Service
Custom
Speech Service
Custom
Language Understanding
Custom
Decision Service
Custom
Search
33. Your bot
Your conversation
logic
Your Business
Logic
Web
service
Bot Builder SDK
(Node.js + C#)
LUIS Translator Bing APIs . . .
Microsoft Cognitive Services
Channels
Azure Hosted
35. Example: Proactive Bot
? ...
Message
sent
to Chatbot
Response
sent
to user
Message
queue
Job
table
Job
queueTimer
http
trigger
out
http
queue
trigger
out
table
timer
trigger
in
table
out
queue
queue
trigger
in
table
Chatbot
36. Functions should “do one thing”
Functions should finish as quickly as possible
Functions should be stateless
Functions should be idempotent
Serverless Computing
https://en.wikipedia.org/wiki/Serverless_computing
“
Serverless computing, also known as Function as a Service (FaaS), is a cloud computing code execution model in which the cloud provider fully manages starting and stopping of function's container PaaS as necessary to serve requests, and requests are billed by an abstract measure of the resources required to satisfy the request, rather than per virtual machine, per hour.
“
Image: Azure Data Center
What is the cloud? The computer of someone else.
Microsoft Azure App Services
https://azure.microsoft.com/en-us/services/app-service/
Try App Services
https://tryappservice.azure.com
App Services have everything you need to build apps that target both web and mobile clients from a single app back-end.
Create web and mobile experiences that share data access and business logic
Automate business processes with logic apps
Build custom APIs or consume connectors from Marketplace
One common billing model for all of your App Services
Resources:
Azure Functions
https://azure.microsoft.com/en-us/services/functions/
Azure Functions developers guide
https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference
Azure Functions GitHub
https://github.com/Azure/Azure-Functions
Introduction:
Azure - Serverless Architecture with Azure Functions
https://msdn.microsoft.com/magazine/mt793269?MC=Windows&MC=MSAzure&MC=Vstudio&MC=OfficeO365&MC=MobileDev&f=255&MSPPError=-2147217396
Introducing Azure Functions
https://azure.microsoft.com/blog/introducing-azure-functions/
Build 2016: Introducing Azure Functions
https://channel9.msdn.com/Events/Build/2016/B858
Build 2017: Design for serverless success on Microsoft Azure
https://channel9.msdn.com/events/Build/2017/B8039
Pricing:
Azure Functions pricing
https://azure.microsoft.com/en-us/pricing/details/functions/
“
Azure Functions consumption plan is billed based on resource consumption and executions. Consumption plan pricing includes a monthly free grant of 1 million requests and 400,000 GB-s of resource consumption per month. Customers can also run Functions within their App Service plan at regular App Service plan rates.
“
Scale:
Azure Functions Consumption and App Service plans
https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale
Making Azure Functions more “serverless”
https://blogs.msdn.microsoft.com/appserviceteam/2016/11/15/making-azure-functions-more-serverless/
“
1.5GB max memory and a 5-minute max execution time
“
Serverless compute is a fully managed service. It abstracts you of servers, infrastructure and configuration of operating system. Some refer to it as Functions as a Service
OS and Framework patching is performed for you
There is zero administrative tasks and no need to manage any infrastructure
You just deploy your code (function) and it runs
Your code runs within seconds and for very short period of time
Serverless compute scales quickly (almost instantly) and vastly
Automatically scales within seconds
No scale configuration is required (there is no way to configure scale or limits)
Scales to match any given workload. Scales from zero to handle tens of thousands concurrent functions invocations within seconds
Pay only for the time your code is running
Serverless compute reacts to events
React, in near real-time, to events and triggers
Triggered by virtually any event from Azure service or 3rd party services
Dual abstraction:
Serverless compute abstracts away the compute
Bindings abstract away the services you interact with
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
Dynamic
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
“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.)
Supported Languages: C#, Node/JavaScript, F#, Python, PHP, Batch, Basch, PowerShell.
Bind into services:
Azure Service Bus, Azure Event Hub, Azure Storage, Azure DocumentDB, OneDrive,
DropBox, Sengrid, Box, Twilio
Publishing a .NET class library as a Function App
https://blogs.msdn.microsoft.com/appserviceteam/2017/03/16/publishing-a-net-class-library-as-a-function-app/
Loosely coupled components
Build/use micro-functionality to react to a single event
Events happening async outside client application
Signs that a serverless pattern might be useful for a given scenario:
Stateless Scale
Not worth deploying a traditional backend
Workload is sporadic (very low & high scale)
Dev ops favored versus dedicated ops
Lots of different services involved that need “glue”
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.
Built around App Service:
Runs on existing App Hosting plans
Run alongside Web, Mobile, and API Apps
Can deploy via existing App Service ARM APIs
All the features of App Service
Continuous Deployment
Deployment Slots
Remote Debugging
Run in your own isolated and dedicated environment
App Service Environment helps run dedicated App Services
Run inside of your own VNET, with your own frontend and firewall
How the Consumption plan works
https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale
“
The Consumption plan automatically scales CPU and memory resources by adding additional processing instances, based on the needs of the functions running in the function app. Every function app processing instance is allocated memory resources up to 1.5 GB.
“
host.json
https://github.com/Azure/azure-webjobs-sdk-script/wiki/host.json
Learn how to work with triggers and bindings in Azure Functions
https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings
(* - All triggers have associated input data)
(** - The HTTP output binding requires an HTTP trigger)
New integrated portal for Azure Functions
https://blogs.msdn.microsoft.com/appserviceteam/2017/04/10/new-integrated-portal-for-azure-functions/
Azure Functions Proxies public preview
https://blogs.msdn.microsoft.com/appserviceteam/2017/02/22/azure-functions-proxies-public-preview/
“
Azure Functions Proxies, a new capability that makes it easier to develop APIs using Azure Functions. Proxies lets you define a single API surface for multiple function apps. Any function app can now define an endpoint that serves as a reverse proxy to another API, be that another function app, an API app, or anything else.
“
Creating Versioned APIs with Azure Functions and Proxies
http://dontcodetired.com/blog/post/Creating-Versioned-APIs-with-Azure-Functions-an-Proxies
Azure Functions API development updates
https://blogs.msdn.microsoft.com/appserviceteam/2017/05/10/azure-functions-api-development-updates/
“
Request and response transforms for Azure Functions Proxies
“
Announcing Azure Functions Open API (Swagger) support preview
https://blogs.msdn.microsoft.com/appserviceteam/2017/03/30/announcing-functions-swagger-support/
“
These features integrate with the existing Azure App Service API definition support to allow you to consume your API on a variety of 1st party services, including PowerApps, Flow, and Logic Apps, as well as the ability to generate SDKs for your API in Visual Studio.
“
Deployment Slots Preview for Azure Functions
https://blogs.msdn.microsoft.com/appserviceteam/2017/06/13/deployment-slots-preview-for-azure-functions/
Azure Functions now has direct integration with Application Insightshttps://blogs.msdn.microsoft.com/appserviceteam/2017/04/06/azure-functions-application-insights/
Application Insights integration with Functions now in preview
https://blogs.msdn.microsoft.com/appserviceteam/2017/05/10/application-insights-integration-with-functions-now-in-preview/
Azure Functions Tools for VS2017
https://blogs.msdn.microsoft.com/webdev/2017/05/10/azure-function-tools-for-visual-studio-2017/
Introducing Azure Functions Runtime preview
https://azure.microsoft.com/es-es/blog/introducing-azure-functions-runtime-preview/
“
Azure Functions Runtime brings the simplicity and power of Azure Functions to on-premises.
“
Azure Functions Runtime Overview
https://docs.microsoft.com/en-us/azure/azure-functions/functions-runtime-overview
Azure Functions Runtime Preview Download
https://www.microsoft.com/en-us/download/details.aspx?id=55239&WT.mc_id=rss_alldownloads_all
Not Artificial Intelligence (AI):
Bots can be simple task automation utilities.
Example: Password reset bot. There’s no AI here. Just ask a couple of security validation questions, then reset the password.
They may have AI as well, if the scenario applies
Not only Natural Lenguage Processing (NLP):
Natural language processing has limitations, still. The more your bot depends on NLP, the worse the experience gets. Hint: Typing isn’t always the best option.
Move away from NLP as quickly as possible
“Drive” the user as much as you can (menus, choices, etc). Less typing = better
Not only text interfaces:
Bot channels are evolving quickly to support richer experiences: Media, buttons, custom controls. These are here or on their way. Text is not known to the best experience for everything.
Examples:
Skype allows audio and 3D bots as well.
Slack, Facebook and Skype have buttons/custom UIs
Siri, Cortana, the old-school MS Clippy and even AOL’s SmarterChild are some examples. Essentially, bots perform automated tasks that are generally REPETITIVE for humans to do. We want to make life easier for the end user of the bot.
Bots are apps. They can:
Exist in different channels and across platforms.
Do anything from simple task automation like taking food orders to leveraging sophisticated deep learning algos as is used by CaptionBot (https://www.captionbot.ai/ which describes the contents of an image how a human would) and otherAI-esque capabilities.
What a bot can do is only limited to the APIs your bot uses.
Bots don’t have to leverage the MS Bot Framework (e.g. MimikerAlarm https://www.microsoft.com/cognitive-services/en-us/mimickeralarm, an app for waking you up), but the Framework makes dev and deploy much simpler and faster for.
Based on this blog post: http://willschenk.com/bot-design-patterns/?imm_mid=0e50a2&cmp=em-data-na-na-newsltr_20160622 about different bot types and the definitions of these.
Notifier - simply broadcast messages aka push bot e.g. ping me when there's a interesting tweet about Hadley Wickam
Reactor - reacts to messages on service, but doesn’t persist anything (message, user state, location) e.g. send me the stock price for a stock I specify, but don't remember me or what I say
Responder - reacts to messages on service, persists message and knows who I am e.g. send me today's weather forecast for a city, use my user name on this channel, and remember what cities I choose
Conversationalist – reacts to messages, persists messages, knows who I am, knows about the “place” I’m at (channel, room,…), knows the state of the conversation e.g. send me today's weather forecast for a city, use my user name on this channel, remember what cities I choose, format it nicely for this channel, and if the conversation is old, archive it and send as email.
From “Bot Design Patterns”: Questions that help us formulate what kind of bot we might want or need:
Do they react to messages?
Do they know who they are talking to?
Can they learn from what was said?
Do they know where the conversation is taking place?
Do they remember the overall conversation?
https://en.wikipedia.org/wiki/Bot#Computing
“
Chatterbot or Chat bot, a computer program that converses in natural language
“
https://en.wikipedia.org/wiki/Chatterbot
“
A chatterbot (also known as a talkbot, chatbot, Bot, chatterbox, Artificial Conversational Entity) is a computer program which conducts a conversation via auditory or textual methods. Such programs are often designed to convincingly simulate how a human would behave as a conversational partner, thereby passing the Turing test. Chatterbots are typically used in dialog systems for various practical purposes including customer service or information acquisition. Some chatterbots use sophisticated natural language processing systems, but many simpler systems scan for keywords within the input, then pull a reply with the most matching keywords, or the most similar wording pattern, from a database.
The term "ChatterBot" was originally coined by Michael Mauldin (creator of the first Verbot, Julia) in 1994 to describe these conversational programs.[1]
“
Microsoft Cognitive Services
http://microsoft.com/cognitive
What’s new (May 2017):
https://azure.microsoft.com/es-es/blog/at-build-microsoft-expands-its-cognitive-services-collection-of-intelligent-apis/
https://blogs.msdn.microsoft.com/jennifer/2017/05/11/ai-announcements-at-the-build-day-1-keynote/
A set of APIs, SDKs and services available to developers to make their applications more intelligent
Easy: Roll your own with REST APIs. Simple to add: just a few lines of code required.
Flexible: Make the same API code call on iOS, Android, and Windows. Integrate into the language and platform of your choice.
Tested: Built by experts in their field from Microsoft Research, Bing, and Azure Machine Learning. Quality documentation, sample code, and community support.
Vision: State-of-the-art image processing algorithms help you moderate content automatically and build more personalized apps by returning smart insights about faces, images, and emotions.
Speech: Processing spoken language in your applications.
Language: Allow your apps to process natural language, evaluate sentiment and topics, and learn how to recognize what users want.
Knowledge: Map complex information and data in order to solve tasks such as intelligent recommendations and semantic search.
Search: Make your apps, webpages, and other experiences smarter and more engaging with the Bing Search APIs.
Labs: Take an early look at emerging Cognitive Services technologies. Early adopters who do not need market-ready technology can discover, try and provide feedback on new Cognitive Services technologies before they are generally available.
Detect intention
http://botframework.com
MS operated service and SDK to build and connect intelligent bots.
Interact with your users naturally wherever they are, from text/sms to Skype, Slack, Office 365 mail and other popular services.
One of many tools for building a complete bot. Others include: LUIS, Speech APIs, Azure, more.
Benefits
For developers
Easiest way to reach the broadest set of users where they already are conversing
Excellent integration with companion services to add intelligence to your bot, such as LUIS for language understanding as well as many other Cognitive Services
For end users
Users can choose from a variety of conversation channels
Users have trust and control of their data
For businesses
Broad access to your customers, new ways to delight them, serve them, do business with them – in your own web site or app or in any number of popular messaging experiences
Reduced cost of development
http://docs.botframework.com/
At Microsoft, we have first-hand experience writing bots and building artificial intelligence systems, so we’ve shared our services and tools so you can use them to add conversations to your own products.
First up are Microsoft’s Cognitive Services, for adding artificial intelligence to your experiences.
The next is the Bot Builder SDK, which you use in your code to build conversational smarts.
Lastly is the Bot Connector, which lets you seamlessly connect your bot up to users on: Skype, Facebook Messenger, SMS, Kik, Slack, and more.
Bot Builder SDK
Everything you need to build great dialogs within your Node.js or C# bot. Also REST
An open source SDK hosted on GitHub.
Dialogs to model conversation
Dialogs are reusable
Types of Dialogs include:
Built-in prompts
Yes/No, String, Number, Choices
FormFlow and form slot filling (branching, disambiguation, multi-turn)
Conversations are scalable to multiple machines
Rich interactions
Support for rich attachments (image, card, video, doc, etc.); support for calling (Skype)
Service extensions for language understanding(LUIS) and translation
Online/offline Chat Emulator
Samples
Bot Connector Service
Connect your bot(s) seamlessly to text/sms, Office 365 mail, Skype, Slack, Twitter and more
A service to register your bot, configure channels and publish to the Bot Directory
Bot Directory
Discover, try, and add bots to conversation experiences.
A public directory of bots registered and approved with Bot Framework.
Developer Portal
Register your bot
Connect to channels
Test
Publish
Manage
Measure
Microsoft Bot Framework November Update – Cross Platform Emulator App, Enhanced Direct Line REST API, Updated SDKs, Card Types and new Azure Bot Service (Preview)
https://blog.botframework.com/2016/11/15/November_Update/
Microsoft Azure Announces Industry’s First Cloud Bot-as-a-Service
https://azure.microsoft.com/en-us/blog/microsoft-azure-announces-industry-s-first-cloud-bot-as-a-service/
Azure Bot Service
https://azure.microsoft.com/en-us/services/bot-service/
Azure Bot Service Overview
https://docs.botframework.com/en-us/azure-bot-service/
Bots-as-a-Service
Use Bot Framework with the Microsoft Azure serverless platform to run and scale your bots while only paying for what you use.
Get started easily with out of the box templates for Node.js and .NET to create a basic bot, language understanding bot, form bot or proactive bot.
Write bot code directly in the browser experience within Azure, test using the Web Chat control or use the IDE and code editor of your choice.
Configure conversation channels from either Azure or the Bot Framework Developer Portal.
Take advantage of integrated continuous deployment so you can use your preferred DevOps tool chain and commit code to popular source control systems such as GitHub, BitBucket, and Visual Studio Team System and automatically publish the code into Azure to continuously improve your bot.
CognitiveBotServerless demo
https://en.wikipedia.org/wiki/Stateless_protocol
“
Stateless
treats each request as an independent transaction that is unrelated to any previous request so that the communication consists of independent pairs of request and response. A stateless protocol does not require the server to retain session information or status about each communications partner for the duration of multiple requests.
“
https://en.wiktionary.org/wiki/idempotent
“
idempotent
(mathematics, computing) Said of a function: describing an action which, when performed multiple times on the same subject, has no further effect on its subject after the first time it is performed. A projection operator is idempotent.
“
This is the whole (top level) Dev Ops story where Dev build wounderful apps, using CI they manage their code, builds and releases. Connecting to a repository, they can deploy to Azure Websites, build in the cloud, deploy to a slot to test and validate, swap into production, deployed across the globe as needed, monitor and get feedback, on which devs can make updates. Rinse and repeat.
Run and debug locally
Not an emulator or simulator!
Run the Functions runtime on your local machine
Functions invoked (triggered) based on events in Azure
Serverless is the future of Cloud Computing
Azure has an awesome Serverless offering
Azure Function is the linchpin for Serverless