1 / 34

Alex Karcher

Alex Karcher. Program manager – Microsoft. 5 tips for production ready Azure Functions. Common Architecture Patterns. Serverless APIs Mobile / Web backends Event and Stream Processing IoT event and data processing Big data and machine learning pipelines

rsandoval
Download Presentation

Alex Karcher

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Alex Karcher • Program manager – Microsoft 5 tips for production ready Azure Functions

  2. Common Architecture Patterns • Serverless APIs • Mobile / Web backends • Event and Stream Processing • IoT event and data processing • Big data and machine learning pipelines • Integration and Enterprise Service Bus • Connecting line-of-business systems • Pub/Sub for business events • Automation and Digital Transformation • Process automation

  3. Tip 1:Serverless APIs and HTTP

  4. Sample synchronous serverless architecture CosmosDB API Management (primary) Traffic Manager API Management (secondary) CosmosDB

  5. Azure Functions “Behind the scenes” HTTP Request HTTP Response

  6. Functions “Behind the scenes” Azure Infrastructure Functions Instance Functions Instance Functions Instance Azure Functions Runtime HTTP Request Azure Functions (App Services) HTTP Front-end HTTP Response Azure Functions Runtime Scale Controller Azure Functions Runtime

  7. Scalability Considerations • The “Scale Controller” determines how many instances are actively doing work • For Event Hub, Queue, Service Bus the scale controller can assess message backlog length and burndown rate to scale • For HTTP functions today looks at request queue for each instance • The “host.json” config file allows you to set instance limits for concurrency at an instance level • Other knobs are to turn off file-system logging, and not include a dashboard storage account

  8. Your App in Concept

  9. Your app with long cold start

  10. Your app with one pre-warmed instance

  11. Scale out settings

  12. Your app with one pre-warmed instance Minimum Plan Size

  13. Your app with a 3 instance min plan size Minimum Plan Size

  14. Tip 2:Event Stream Processing

  15. Sample synchronous serverless architecture CosmosDB Devices and Clients Event / IoT Hubs

  16. Event Stream Processing: Scaling

  17. Sample synchronous serverless architecture Event / IoT Hubs Function Instances Devices and Clients CosmosDB

  18. Sample synchronous serverless architecture Event / IoT Hubs Function Instances Devices and Clients Device 1 Partition 1 Partition 2 CosmosDB Partition 3 Partition 4

  19. Sample synchronous serverless architecture Event / IoT Hubs Function Instances Devices and Clients Device 1 Partition 1 Partition 2 CosmosDB Partition 3 Partition 4

  20. Sample synchronous serverless architecture Event / IoT Hubs Function Instances Devices and Clients Device 1 Partition 1 Device 2 Partition 2 CosmosDB Device 3 Partition 3 Device 4 Partition 4

  21. Sample synchronous serverless architecture Event / IoT Hubs Function Instances Devices and Clients Device 1 Partition 1 Device 2 Partition 2 CosmosDB Device 3 Partition 3 Device 4 Partition 4 Device 5

  22. Sample synchronous serverless architecture Event / IoT Hubs Function Instances Devices and Clients Device 1 Partition 1 Device 2 Partition 2 CosmosDB Device 3 Partition 3 Device 4 Partition 4 Device 5

  23. Sample synchronous serverless architecture Event / IoT Hubs Function Instances Devices and Clients Device 1 Partition 1 Device 2 Partition 2 CosmosDB Device 3 Partition 3 Device 4 Partition 4 Device 5

  24. Scalability Considerations • This is a bread-and-butter serverless scenario – elastic growth • Process messages in a batch (`EventData[]`) – “cardinality: many” • Only one active instance per partition • You can guarantee ordering with Event Hubs • You must handle exceptions yourself. No deadletter queue • Messaging choices: • Event Hubs – high scale, high throughput, ordering is preserved • Service Bus Queues / Topics – ”never lose a message”, ordering via sessions. Good for high variable workloads • Storage Queues – inexpensive, less “enterprise” and message broker features • Event Grid – send an ”event” out, any subscribers can get poked to be alerted. No ordering, no transnationality

  25. TIP 3 - EventHub Scale Options • Add partitions • You can raise beyond 32 by contacting support 🤫 • Increase Functions instance size • Premium Plan

  26. Inner and Outer Loop Development Outer Loop Build and Test (CI) Run (Prod) Deploy (CD) Code Run Debug Inner Loop Monitoring and Diagnostics Source Control

  27. Inner and Outer Loop Development Outer Loop Build and Test (CI) Run (Prod) Deploy (CD) Code Run Debug Inner Loop Monitoring and Diagnostics Source Control

  28. Tip 4: Azure DevOps for CI/CD

  29. Dev Ops GA of Functions Build task Easily add Functions to a CI/CD pipeline New streamlined CLI command azfunctionappdevops-pipeline create Automatically configures DevOps to build with new commits to your version control Configures Github or Azure Repos automatically aka.ms/functions-azure-devops

  30. Inner and Outer Loop Development Outer Loop Build and Test (CI) Run (Prod) Deploy (CD) Code Run Debug Inner Loop Monitoring and Diagnostics Source Control

  31. Tip 5: Monitoring • Gain real-time observability • Analyze and debug traces and metrics • View dependencies and relationships with AppMap Application Insights

  32. Application Map

  33. Distributed Tracing

  34. Alex Karcher • Product manager – Microsoft 5 tips for production ready Azure Functions

More Related