using azure functions for integration
TRANSCRIPT
PRESENTSTECHNOLOGY PARTNER
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10,
2016
Tulika Chaudharie / Harikharan Krishnaraju Escalation Engineer, Microsoft
Using Azure Functions for Integration
2
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
What is Azure App Service?
AzureFunctions
APIM
Notification Hubs Web
Apps
Mobile Apps
API Apps
Logic Apps
Custom AppseCommerce Digital Global Presence LOBApps
Services
App ServiceDeveloper Experience • Languages and Frameworks
• Superior DevOps• Self service supportability
Fully Managed Platform• Auto scale• OS and Framework patching• Load balancing
Enterprise Grade
• Enterprise grade SLA• Security and
Compliance• On-Premise
ConnectivityPlatform
API / Services / ISV
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Demo: Azure WebJob
4
Azure FunctionsProcess events with Serverless code.
Make composing Cloud Apps insanely easyDevelop Functions in C#, Node.js, F#, Python, PHP, Batch and more Easily schedule event-driven tasks across servicesExpose Functions as HTTP API endpointsScale Functions based on customer demandEasily integrate with Logic Apps
Code Events + data
Azure Functions
AzureFunctions
6
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016Azure Functions architecture
Built on top of App Service and WebJobs SDK
App Service Dynamic RuntimeHosting, CI, Deployment Slots, Remote Debugging, etc.
WebJobs CoreProgramming model, common abstractions
WebJobs ExtensionsTriggers, input and output bindings
WebJobs Script RuntimeAzure Functions Host – Dynamic Compilation, Language abstractions, etc.
Code Config
• Language RuntimeC#, Node.js, F#, PHP, etc.
7
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Dual abstraction• Serverless compute abstracts away the compute• Bindings abstract away the services you interact with
Business Logic
Serverless PaaS
Other Services
8
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
• 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
Platform and scaling
9
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Pay per execution model - two meters, three units
• Number of executions• Duration of execution x reserved memory
Dynamic Tier Pricing
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Demo: Function – Getting Started
10
11
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
• Function as the unit of work• Functions are executed; they start and finish• Functions have inputs and outputs
What is the “Functions” programming model?
12
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
• Functions should “do one thing”• Functions should be idempotent• Functions should finish as quickly as possible
Best practices for the “Functions” model
1
13
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016Functions programming concepts
Trigger Input
OutputCode
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Demo: Storage Queue Trigger
14
15
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
• GeneralizingWebJobs SDK == more freedom -> more workAzure Functions == less responsibilities -> less work
• CommonalitiesProgramming model differencesHosting model differences
WebJobs SDK vs Azure Functions
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
• Both use the ”Function” oriented programming model• Both support ”bindings” for trigger/input/output• Both support WebJobs SDK extensions model• Both support external libraries being used• Both can run locally and be debugged• Both have runtime telemetry via the WebJobs
Dashboard
16
Commonalities
17
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Programming Model DifferencesWebJobs SDK
C# onlyAttributes for configuring
bindingsTraditional .NET developer
experience (Visual Studio, NuGet, MSBuild)
Many functions per classCan access and manipulate
many core SDK featuresCan’t listen for HTTP
requests*
Azure FunctionsC# & Node.js + more Config files for configuring
bindingsMore diverse development
experience (Web portal, VSCode, dynamically builds itself)
Limited access to manipulate core SDK features, but (C# only) still some access
Supports HTTP!
18
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Hosting Model Differences• WebJobs SDK
• You configure host• Build a console app which is
run
• WebJobs and Dedicated App Service plans• Runs the service in the
background of Web/Mobile/API app
• Runs any console app (not just SDK based ones)
• You manage scale
• Azure Functions• Limited control over the host• Just give it your code/config
• Function App + Dynamic App Service Plans• Function app owns the whole host,
including web frontend.• Only runs Azure Functions stuff – no
other things• Scale is managed for you
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Demo: Integration with Logic Apps
19
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Questions?
20
INTEGRATION DAYMICROSOFT GTSC,
BengaluruSeptember 10, 2016
Thank You!
21