Azure Functions e Logic Apps
I tuoi coltellini svizzeri per gestire i tuoi
dati in un SQL Database
@marco_parenzan
@marco_parenzan
.NET, IoT and Azure Developer, Trainer and Consultant
Microsoft MVP 2017 for Azure
Book Author @ Packt, LSWR
Community Lead per 1nn0va
What SQL Database needs
What SQL Database needs
SQL Database is Database as a
Service
It is only the database
Vs. SQL20xx
Almost language syntax aligned
Deprecated features
Migrate features to External/Other
Azure Services
Overlapping features (ex. JSON)
Serverless as glue
Choose your abstraction
Serverless manifesto
Function are the unit of
deployment and scaling.
Scales per request Users cannot
over- or under-provision
capacity.
Never pay for idle (no cold
servers/containers or their costs)
Trigger-based invocation code
run because of an event
happened and has to be handled
Serverless as a bridge for SQL Databases
Import/Export
Other data formats
Data manipulations
Schedules
Other Azure services bridges
What is Azure Serverless
A serverless nirvana? Microsoft Azure CTO Mark Russinovich on the future of the cloud
https://www.geekwire.com/2017/serverless-nirvana-microsoft-azure-cto-mark-russinovich-future-cloud/
Functions
Azure Functions
Process events with Serverless code.
Make composing Cloud Apps insanely easy
Develop Functions in C#, Node.js, Python, PHP, Batch
and more
Easily schedule event-driven tasks across services
Expose Functions as HTTP API endpoints
Scale Functions based on customer demand
Azure Functions architecture
Azure Functions is built around the WebJobs SDK runtime.
The WebJobs SDK makes it easy to react to events and
work with data in a consistent abstracted fashion.
Platform and scaling
App Service offers dedicated and consumption tiers.
Dedicated is the existing App Service plan tiers
Basic, Standard, Premium
Pay based on # of reserved VMs
You’re responsible for scale
Consumption (Dynamic)
Pay per execution model - two meters, three units
Number of executions
Duration of execution x reserved memory
Supported bindings
Type Service Trigger Input Output
Schedule Azure Functions ✔
HTTP (REST or WebHook) Azure Functions ✔ ✔
Blob Storage Azure Storage ✔ ✔ ✔
Queues Azure Storage ✔ ✔
Tables Azure Storage ✔ ✔
No-SQL DB Azure CosmosDB ✔ ✔
Streams Azure Event Hubs ✔ ✔
Push Notifications Azure Notification Hubs ✔
IoT Azure IoT Hub ✔
Supported Languages
1st class support
Node/JavaScript
C# (.NET Framework 4.7.x)
F#
Experimental support
.NET Core
Linux Containers
Java
Python
PHP
Batch
Bash
PowerShell
Developing Functions
Portal
Local runtime
Visual Studio 2017
Visual Studio Code
Windows (.NET 4.6.1) 1.0
Windows/Linux (.NET Core 2.0) 2.0
Functions Programming Model
Function as a single unit of work
Functions are executed per trigger
Functions have inputs and outputs
Trigger
(data) Input Input
code
Output
Output
Input
Durable Functions
Enable “long running”
functions while maintaining
local state.
Simplify complex Function
coordination (chaining, etc.)
Easily call a Function from
another Function
All of the above using code-
only
Functions and Logic Apps
Functions and Logic Apps work great together and that integration
will only get better.
You can orchestrate Functions using Logic Apps today.
Durable Functions overlaps with Logic Apps, one function calling
another, but:
-Offers advance ‘code only’ orchestration ‘like’ capabilities to function
-Enables "long running" functions
-Enables "advance" scenarios/patterns which are difficult otherwise:
async HTTP, map reduce, actors, etc.
Logic Apps
Shared with Functions
Serverless
App Service based
Triggers (templated)
Unique for Logic Apps
«Older»/Mature(?)
Implement and orchestrate visually designed integration
workflows
Orchestrate distributed microservices
Or Functions
Every action is a an http endpoint
Connectors
Declarative
No code designer for rapid creation (mostly?)
Logic Apps Connectors (120+)
Concepts
Simple-to-advanced flow control like conditions, loops, exception handling, and
parallel
Multiple Patterns
Manual Invocation
Event Based
Scheduled
Workflows
Triggers
Actions
Managed APIs
Flow structures
Workflow Definition Language
“Code Behind”
Basic Structure
Pricing
Different billing model from Function App
No App Service Plan 
Per action (each step in a Workflow is an action, also a trigger)
More details https://azure.microsoft.com/en-us/pricing/details/logic-apps/
ACTIONS EXECUTED PER MONTH PRICE PER ACTION EXECUTION
First 250K actions €0.000675/action
250K–1M actions €0.000338/action
1M–50M actions €0.000127/action
50M–100M actions €0.000076/action
100M+ actions €0.000046/action
Scale & Performance
100MB message size
90 days run duration
1 sec to 500 days recurrence interval
100’000 ForEach items
10’000 actions executions per 5 minutes
Request Timeout 120 Seconds
Run duration 90 days
ForEach items 100,000
Actions executions per 5 minutes 100,000
Actions per workflow 250
Allowed action nesting depth 5
Triggers per workflow 10
Different billing model from Function App
Why do we need “Durable Functions”
Enable “long running” functions while maintaining
local state.
Simplify complex Function coordination (chaining,
etc.)
Easily call a Function from another Function
All of the above using code-only
Cognitive Services
Vision
From faces to feelings, allow your
apps to understand images and video
Speech
Hear and speak to your users by filtering noise, identifying speakers, and understanding intent
Language
Process text and learn how to recognize what users want
Knowledge
Tap into rich knowledge amassed from
the web, academia, or your own data
Search
Access billions of web pages, images, videos, and news with the power of Bing APIs
Cognitive Services
microsoft.com/cognitive
Bing Web Search
Search Vision Speech Language Knowledge
Computer Vision Bing Speech Bing Spell Check
Academic
Knowledge
Bing Autosuggest
Bing Image Search
Content
Moderator
Custom Speech
Service
Linguistic Analysis
Entity Linking
Bing Video Search
Emotion
Speaker
Recognition
Language
Understanding
Knowledge
Exploration
Bing News Search
Face Translator Text Analytics QnA Maker
Video WebLM Recommendations
Bing Web Search
Bing Image Search
Bing Video Search
Bing News Search
Bing Autosuggest
Bing Spell Check
Video Indexer
Custom Vision
Service
Bing Custom
Search
Bing Custom
Search
Custom Decision
Service
Conclusions
Conclusions
Function
fast and easy tool to start
Great growth potential
Lot of investments by Microsoft and the entire Cloud world
Bot Framework (and potentially others tools) bonus
Logic Apps
«Biztalk restart»
Declarative/visual advantage
Connectors growth
Thanks
You can find me at:
marco [dot] parenzan [at] 1nn0va [dot] it
@marco_parenzan
Code at:
https://github.com/marcoparenzan/SQLSAT707

Azure Functions e Azure Logics Apps: i tuoi coltellini svizzeri per gestire i tuoi dati in un SQL Database

  • 1.
    Azure Functions eLogic Apps I tuoi coltellini svizzeri per gestire i tuoi dati in un SQL Database @marco_parenzan
  • 3.
    @marco_parenzan .NET, IoT andAzure Developer, Trainer and Consultant Microsoft MVP 2017 for Azure Book Author @ Packt, LSWR Community Lead per 1nn0va
  • 4.
  • 5.
    What SQL Databaseneeds SQL Database is Database as a Service It is only the database Vs. SQL20xx Almost language syntax aligned Deprecated features Migrate features to External/Other Azure Services Overlapping features (ex. JSON)
  • 6.
  • 7.
  • 8.
    Serverless manifesto Function arethe unit of deployment and scaling. Scales per request Users cannot over- or under-provision capacity. Never pay for idle (no cold servers/containers or their costs) Trigger-based invocation code run because of an event happened and has to be handled
  • 9.
    Serverless as abridge for SQL Databases Import/Export Other data formats Data manipulations Schedules Other Azure services bridges
  • 10.
    What is AzureServerless A serverless nirvana? Microsoft Azure CTO Mark Russinovich on the future of the cloud https://www.geekwire.com/2017/serverless-nirvana-microsoft-azure-cto-mark-russinovich-future-cloud/
  • 11.
  • 12.
    Azure Functions Process eventswith Serverless code. Make composing Cloud Apps insanely easy Develop Functions in C#, Node.js, Python, PHP, Batch and more Easily schedule event-driven tasks across services Expose Functions as HTTP API endpoints Scale Functions based on customer demand
  • 13.
    Azure Functions architecture AzureFunctions is built around the WebJobs SDK runtime. The WebJobs SDK makes it easy to react to events and work with data in a consistent abstracted fashion.
  • 14.
    Platform and scaling AppService offers dedicated and consumption tiers. Dedicated is the existing App Service plan tiers Basic, Standard, Premium Pay based on # of reserved VMs You’re responsible for scale Consumption (Dynamic) Pay per execution model - two meters, three units Number of executions Duration of execution x reserved memory
  • 15.
    Supported bindings Type ServiceTrigger Input Output Schedule Azure Functions ✔ HTTP (REST or WebHook) Azure Functions ✔ ✔ Blob Storage Azure Storage ✔ ✔ ✔ Queues Azure Storage ✔ ✔ Tables Azure Storage ✔ ✔ No-SQL DB Azure CosmosDB ✔ ✔ Streams Azure Event Hubs ✔ ✔ Push Notifications Azure Notification Hubs ✔ IoT Azure IoT Hub ✔
  • 16.
    Supported Languages 1st classsupport Node/JavaScript C# (.NET Framework 4.7.x) F# Experimental support .NET Core Linux Containers Java Python PHP Batch Bash PowerShell
  • 17.
    Developing Functions Portal Local runtime VisualStudio 2017 Visual Studio Code Windows (.NET 4.6.1) 1.0 Windows/Linux (.NET Core 2.0) 2.0
  • 18.
    Functions Programming Model Functionas a single unit of work Functions are executed per trigger Functions have inputs and outputs Trigger (data) Input Input code Output Output Input
  • 19.
    Durable Functions Enable “longrunning” functions while maintaining local state. Simplify complex Function coordination (chaining, etc.) Easily call a Function from another Function All of the above using code- only
  • 20.
    Functions and LogicApps Functions and Logic Apps work great together and that integration will only get better. You can orchestrate Functions using Logic Apps today. Durable Functions overlaps with Logic Apps, one function calling another, but: -Offers advance ‘code only’ orchestration ‘like’ capabilities to function -Enables "long running" functions -Enables "advance" scenarios/patterns which are difficult otherwise: async HTTP, map reduce, actors, etc.
  • 21.
  • 22.
    Shared with Functions Serverless AppService based Triggers (templated)
  • 23.
    Unique for LogicApps «Older»/Mature(?) Implement and orchestrate visually designed integration workflows Orchestrate distributed microservices Or Functions Every action is a an http endpoint Connectors Declarative No code designer for rapid creation (mostly?)
  • 24.
  • 25.
    Concepts Simple-to-advanced flow controllike conditions, loops, exception handling, and parallel Multiple Patterns Manual Invocation Event Based Scheduled Workflows Triggers Actions Managed APIs Flow structures
  • 26.
    Workflow Definition Language “CodeBehind” Basic Structure
  • 27.
    Pricing Different billing modelfrom Function App No App Service Plan  Per action (each step in a Workflow is an action, also a trigger) More details https://azure.microsoft.com/en-us/pricing/details/logic-apps/ ACTIONS EXECUTED PER MONTH PRICE PER ACTION EXECUTION First 250K actions €0.000675/action 250K–1M actions €0.000338/action 1M–50M actions €0.000127/action 50M–100M actions €0.000076/action 100M+ actions €0.000046/action
  • 28.
    Scale & Performance 100MBmessage size 90 days run duration 1 sec to 500 days recurrence interval 100’000 ForEach items 10’000 actions executions per 5 minutes Request Timeout 120 Seconds Run duration 90 days ForEach items 100,000 Actions executions per 5 minutes 100,000 Actions per workflow 250 Allowed action nesting depth 5 Triggers per workflow 10 Different billing model from Function App
  • 29.
    Why do weneed “Durable Functions” Enable “long running” functions while maintaining local state. Simplify complex Function coordination (chaining, etc.) Easily call a Function from another Function All of the above using code-only
  • 30.
  • 31.
    Vision From faces tofeelings, allow your apps to understand images and video Speech Hear and speak to your users by filtering noise, identifying speakers, and understanding intent Language Process text and learn how to recognize what users want Knowledge Tap into rich knowledge amassed from the web, academia, or your own data Search Access billions of web pages, images, videos, and news with the power of Bing APIs Cognitive Services
  • 32.
    microsoft.com/cognitive Bing Web Search SearchVision Speech Language Knowledge Computer Vision Bing Speech Bing Spell Check Academic Knowledge Bing Autosuggest Bing Image Search Content Moderator Custom Speech Service Linguistic Analysis Entity Linking Bing Video Search Emotion Speaker Recognition Language Understanding Knowledge Exploration Bing News Search Face Translator Text Analytics QnA Maker Video WebLM Recommendations Bing Web Search Bing Image Search Bing Video Search Bing News Search Bing Autosuggest Bing Spell Check Video Indexer Custom Vision Service Bing Custom Search Bing Custom Search Custom Decision Service
  • 33.
  • 34.
    Conclusions Function fast and easytool to start Great growth potential Lot of investments by Microsoft and the entire Cloud world Bot Framework (and potentially others tools) bonus Logic Apps «Biztalk restart» Declarative/visual advantage Connectors growth
  • 35.
    Thanks You can findme at: marco [dot] parenzan [at] 1nn0va [dot] it @marco_parenzan Code at: https://github.com/marcoparenzan/SQLSAT707