Pro Yearly is on sale from $80 to $50! »

Moving from App Services to Azure Functions

Moving from App Services to Azure Functions

When we first started out with Azure, we created VM’s to run our web applications and backend services. Afterwards we moved our web application logic into App Services while using native Azure Services for our backend requirements. With containers we could isolate our individual web application components even further and allowed us to go full DevOps. Now Azure Functions allows us to remove a complete application stack allowing us to focus purely on functionality.

In this talk I go over the several phases we went through getting our application from bare metal into the cloud and how we now leverage Azure Functions to achieve higher throughput and faster delivery times while reducing the complexity of the web application and costs.

8fc45f4725efe8e8bc8d6c1f92224b65?s=128

Michelangelo

April 27, 2019
Tweet

Transcript

  1. Moving from App Services to Azure Functions A story of

    how we increased our throughput on Azure 1
  2. Michelangelo van Dam Co-founder/CEO In2it PHP Community Leader Open source

    contributor CoderDojo Coach MVP Azure Moving from App Services to Azure Func5ons 2
  3. How we did things in “the old days” Bare metal

    servers in local DC Optional virtualisation Manual deployments Releases after office hours Moving from App Services to Azure Func5ons 3
  4. Moving from App Services to Azure Func5ons 4 Web App

    MySQL DB Redis Cache Shared FS
  5. Release drama Broken packages De-sync between staging and production servers

    Network issues Hardware issues Moving from App Services to Azure Func5ons 5
  6. We needed better solutions! Moving from App Services to Azure

    Func5ons 6
  7. Discovery of the cloud in 2006 Moving from App Services

    to Azure Func5ons 7
  8. It worked out initially… VM’s for test, staging and production

    that were equal Storage on S3 Moving from App Services to Azure Func5ons 8
  9. Moving from App Services to Azure Func5ons 9 AWS Cloud

    S3 EC2 S3 - Bucket
  10. … but we encountered some cons No cloud native database

    support Very pricy for the services provided Still lots of maintenance to keep our VM’s up-to-date Moving from App Services to Azure Func5ons 10
  11. Managed services Infrastructure support for Java, .Net and Ruby Very

    costly on top of expensive AWS bills Lots of restrictions on what was possible Moving from App Services to Azure Func5ons 11
  12. We needed better solutions! Moving from App Services to Azure

    Func5ons 12
  13. 2008 Windows Azure intro by Josh Holmes at MS Belux

    Moving from App Services to Azure Func5ons 13
  14. Windows Azure was what we needed! Platform as a Service

    You manage your app Microsoft takes care of the platform and infrastructure Separate services for database, cache and much more Supported open source Moving from App Services to Azure Func5ons 14
  15. Automation! Azure allowed us to fully automate the deployment processes

    Moving from App Services to Azure Func5ons 15
  16. Moving from App Services to Azure Func5ons 16 Classical Web

    Application Configuration West Europe PHP Azure Services Azure SQL Storage Blob Storage Queue Sendgrid Services North Europe PHP Azure Services Azure SQL Storage Blob Storage Queue Azure Load Balancing Replication
  17. The DevOps movement Moving from App Services to Azure Func5ons

    17
  18. Docker changed everything Moving from App Services to Azure Func5ons

    18
  19. Some challenges Docker containers are immutable Persistence must be kept

    outside containers Not a lot of examples and sources for best practices Moving from App Services to Azure Func5ons 19
  20. Moving from App Services to Azure Func5ons 20 Persistent File

    Sytem Web Front Web Front Web Front Web Front PHP-FPM PHP-FPM PHP-FPM Worker Worker Worker
  21. Say hello to Kubernetes Moving from App Services to Azure

    Func5ons 21
  22. Managed containers on Azure AKS simplifies deployment and operations of

    Kubernetes Dynamically scale application infrastructure Security provided by Azure AD and Key Vault Cost effective platform for container infrastructure Moving from App Services to Azure Func5ons 22
  23. Moving from App Services to Azure Func5ons 23 Internet Azure

    AKS POD POD SCM CI/CD AKS Node Azure Container Registry
  24. The serverless revolution Moving from App Services to Azure Func5ons

    24
  25. Azure functions Moving from App Services to Azure Func5ons 25

  26. Azure Functions in a nutshell Event-driven serverless compute platform Build

    and debug locally Deploy and operate at scale on Azure Integrate services using triggers and bindings Moving from App Services to Azure Func5ons 26
  27. Inspired by Mr. Hunt https://in2.se/hipb-serverless Moving from App Services to

    Azure Func5ons 27
  28. We want that too… but how? Moving from App Services

    to Azure Func5ons 28
  29. Where could we implement functions? Most requests from customers: product

    details ✓ Most requests from employees: order and support tickets ✓ Most viewed page: sales and shipment dashboards ✓ Moving from App Services to Azure Func5ons 29
  30. Moving from App Services to Azure Func5ons 30

  31. How to get started? Download the Azure Functions Core Tools

    Moving from App Services to Azure Func5ons 31 https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local
  32. Supported Technologies Moving from App Services to Azure Func5ons 32

    Technology V1 V2 C# GA (.NET Framework 4.7) GA (.NET Core 2) JavaScript GA (Node 6) GA (Node 8 & 10) F# GA (.NET Framework 4.7) GA (.NET Core 2) Java N/A GA (Java 8) Python Experimental Preview (Python 3.6) TypeScript Experimental GA (supported through transpiling to JavaScript) PHP Experimental N/A Batch (.cmd, .bat) Experimental N/A Bash Experimental N/A PowerShell Experimental N/A
  33. So how do I get started? Create a directory Init

    a “func” project Write your logic Run & Test locally Push to Azure Run it Moving from App Services to Azure Func5ons 33
  34. Live Demo Moving from App Services to Azure Func5ons 34

  35. The impact of moving to functions Moving from App Services

    to Azure Func5ons 35 0 480 960 1440 1920 2400 Sep 18 Oct 18 Nov 18 Dec 18 Jan 19 Feb 19 Mar 19 Apr 19 switch containers ➤ functions
  36. Our serverless journey has just begon Moving from App Services

    to Azure Func5ons 36 DONE TO DO Product details Procurement Incoming Orders Shipping Callback requests Customer history KPI Dashboards Stock management Portal advertisements Customs declarations Commercial mailings Content management Import regulation management
  37. Some takeaways Prepare for the “next best thing” and have

    a loosely coupled code base Always experiment! It might be good today, but can it be better tomorrow? Azure offers all required tools to get started, but choosing the “right” tool is the hardest part Moving from App Services to Azure Func5ons 37
  38. Our most important lessons Do not create a new client

    with every function invocation (RTFM) Fail early by keeping timeouts as small as possible Moving from App Services to Azure Func5ons 38
  39. 39

  40. Moving from App Services to Azure Func5ons 40 www.in2it.be