Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

DragonBe

April 27, 2019
Tweet

More Decks by DragonBe

Other Decks in Technology

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. Release drama Broken packages De-sync between staging and production servers

    Network issues Hardware issues Moving from App Services to Azure Func5ons 5
  5. 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
  6. … 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
  7. 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
  8. 2008 Windows Azure intro by Josh Holmes at MS Belux

    Moving from App Services to Azure Func5ons 13
  9. 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
  10. Automation! Azure allowed us to fully automate the deployment processes

    Moving from App Services to Azure Func5ons 15
  11. 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
  12. 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
  13. 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
  14. 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
  15. Moving from App Services to Azure Func5ons 23 Internet Azure

    AKS POD POD SCM CI/CD AKS Node Azure Container Registry
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 39