Slide 1

Slide 1 text

Moving from App Services to Azure Functions A story of how we increased our throughput on Azure 1

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

Moving from App Services to Azure Func5ons 4 Web App MySQL DB Redis Cache Shared FS

Slide 5

Slide 5 text

Release drama Broken packages De-sync between staging and production servers Network issues Hardware issues Moving from App Services to Azure Func5ons 5

Slide 6

Slide 6 text

We needed better solutions! Moving from App Services to Azure Func5ons 6

Slide 7

Slide 7 text

Discovery of the cloud in 2006 Moving from App Services to Azure Func5ons 7

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Moving from App Services to Azure Func5ons 9 AWS Cloud S3 EC2 S3 - Bucket

Slide 10

Slide 10 text

… 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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

We needed better solutions! Moving from App Services to Azure Func5ons 12

Slide 13

Slide 13 text

2008 Windows Azure intro by Josh Holmes at MS Belux Moving from App Services to Azure Func5ons 13

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

Automation! Azure allowed us to fully automate the deployment processes Moving from App Services to Azure Func5ons 15

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

The DevOps movement Moving from App Services to Azure Func5ons 17

Slide 18

Slide 18 text

Docker changed everything Moving from App Services to Azure Func5ons 18

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

Say hello to Kubernetes Moving from App Services to Azure Func5ons 21

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

Moving from App Services to Azure Func5ons 23 Internet Azure AKS POD POD SCM CI/CD AKS Node Azure Container Registry

Slide 24

Slide 24 text

The serverless revolution Moving from App Services to Azure Func5ons 24

Slide 25

Slide 25 text

Azure functions Moving from App Services to Azure Func5ons 25

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

Inspired by Mr. Hunt https://in2.se/hipb-serverless Moving from App Services to Azure Func5ons 27

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

Moving from App Services to Azure Func5ons 30

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

Live Demo Moving from App Services to Azure Func5ons 34

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

39

Slide 40

Slide 40 text

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