KEMBAR78
Serverless Computing With Azure Functions | PPTX
Serverless Computing with
Azure Functions
Jaliya Udagedara
Microsoft MVP (Visual Studio & Development
Technologies)
Line-up
• Serverless Computing
• Azure Functions
• Triggers & Bindings
• Authorization
• Azure Functions Proxies
• Demo
• Performance Considerations
Serverless Computing
• Requires Servers
• Infrastructure details are abstracted
• Cloud provider manages resources
• Driven by events and triggers
• Pay only for the time your code is running
Azure Functions
BoxOneDrive Twilio
Dropbox Sendgrid
Azure
Storage
Develop
your way
Local
development
Event-driven
scale
Reduced
Dev Ops
Programming Model
Triggers and Bindings
• Triggers: Defines how a function is invoked
• Bindings
• Input
• Output
• return value
• out parameter
• collector object
Azure Functions Security
• Applies to HTTP Triggers
• Supports API Keys
• Host Keys
• Function Keys
•Integrated security with popular OAuth providers
Azure Functions Proxies
• Single API Surface
• Request/Response Transformations
• Mocking
Demo
Function App using Portal
Function App using Visual Studio
Azure Function Proxies
Performance Considerations
• Avoid long running functions
• Cross function communication
• Write functions to be stateless
• Write defensive functions
• Use async code but avoid blocking calls
References
• Demo Code
• Official Documentation
• Samples and Content
• Tools
• Azure Storage Explorer
• Azure Storage Emulator
• Azure Cosmos DB Emulator
Q & A
https://www.rateevent.com/rate/SCAAA347

Serverless Computing With Azure Functions

Editor's Notes

  • #2 Pre-check Browser Font Size Visual Studio Font Size Start Cosmos DB local storage browser
  • #4 Serverless Computing-misnomer Infrastructure OS and Framework There is zero administrative tasks You just deploy your code (function) and it runs Serverless compute scales quickly (almost instantly) and vastly Automatically scales within seconds Difference between PaaS(Platform as a Service) With PaaS, you still need to select the OS, VM Size, Scaling and pay for that even it’s not being utilized
  • #5 Serverless Accelerate development C#/F#/JavaScript Experimental Languages: Python, PHP, TypeScript, Batch (.cmd, .bat), Bash, PowerShell Bring your own dependencies: Nuget and NPM Flexible development Visual Studio VS Code Portal Azure CLI Simplified integration Azure Cosmos DB, Storage, Service Bus, Notification Hubs, SendGrid, Twillio etc.
  • #7 Triggers: A function must have exactly one trigger Bindings provide a declarative way to connect to data from within your code. Bindings are optional and a function can have multiple input and output bindings.
  • #8 Authorization Types Anonymous Function Admin – Host Keys -> _master OAuth Providers: Azure Active Directory, Facebook, Google, Twitter, and Microsoft Account
  • #9 Multiple Azure functions as a Single API Surface
  • #11 Avoid long running functions Default 5 minutes, Max 10 minutes Cross function communication Use storage queues for cross function communication Write functions to be stateless Functions should be stateless and idempotent if possible Explain: Idempotent Write defensive functions Query for 10,000 rows in a db Create a queue message for each of those rows to process further down the line What if breaks at 5000 Answer: Track items in a set that you’ve completed. Use async code but avoid blocking calls Avoid getting Result