Slide 1

Slide 1 text

Serverless + APIM Daron Yöndem Azure Application Development Lead for MEA Microsoft http://daron.me @daronyondem

Slide 2

Slide 2 text

Serverless != Microservices • You can have a fleet of EC2 instances, running containers, orchestrating and still worry about infrastructure. • You can have dozens of functions tightly coupled and delivered as a behemoth.

Slide 3

Slide 3 text

Talking Serverless on Azure Serverless Functions – Azure Functions Serverless Containers – Azure Container Instances Serverless NoSQL – Cosmos DB Serverless SQL – Azure SQL Database Serverless Tier Serverless Eventing – Event Grid + Hub Serverless API Management – Consumption Tier APIM

Slide 4

Slide 4 text

Azure Functions 101 • Javascript (Node.js 14) • C# / F# (.NET 6) • Java 11 & 7 • Powershell 7 • Pyhton 3.9, 3.8 • Go / Rust (Custom Handlers / Unofficial)

Slide 5

Slide 5 text

What for? • Timer-based processing • SaaS Event Processing • Full Serverless Architecture • Real-Time Stream Processing • Real-Time Bot Messaging • Serverless API Backends

Slide 6

Slide 6 text

Where? • Azure Public Cloud • Azure Arc everywhere (AWS, GCP, On-Prem) • Wherever you have Kubernetes through KEDA • Self scale with custom containers. • On my machine!

Slide 7

Slide 7 text

Billing Model? • Consumption Plan • Execution Time GB-s • Execution Count • Premium Plan • VNet Access • vCPU / Second (Min 1) • Memory Allocated (Second) • Functions on Kubernetes – Kind of Free • Functions in App Service Plan – Kind of Free

Slide 8

Slide 8 text

Authentication • Anoymous • Function Key • Host Key • Federated Identity through App Service • Azure AD, Facebook, Google, Twitter, OpenID • Managed Identity • Certificate Authentication

Slide 9

Slide 9 text

Hello world! DEMO

Slide 10

Slide 10 text

Function Triggers and Bindings • A trigger defines how a function is invoked. • Triggers have associated data, which is usually the payload that triggered the function. • Input and output bindings provide a declarative way to connect to data from within your code.

Slide 11

Slide 11 text

Creating our first “timer trigger” function! DEMO

Slide 12

Slide 12 text

What you can do with timer triggers? • Run at explicitly specified intervals, like every day at 2:00 am using CRON expressions, like “0 */5 * * * *“ (every 5 minutes) • Can send information to other systems, but typically don’t “return” information, only write to logs • Great for redundant cleanup and data management • Great for checking state of services • Can be combined with other functions

Slide 13

Slide 13 text

Creating our first output binding. DEMO

Slide 14

Slide 14 text

Creating an image resizer function DEMO

Slide 15

Slide 15 text

Stateful Functions and Workflows! • Stateful functions • Managed state, checkpoints, and restarts when needed. • Define stateful workflows in orchestrator functions. .

Slide 16

Slide 16 text

Problem 1 : Function Chaining • No visualization to show relationship between functions and queues. • Middle queues are an implementation detail – conceptual overhead. • Error handling adds a lot more complexity.

Slide 17

Slide 17 text

Function chaining DEMO

Slide 18

Slide 18 text

Problem 2 : Fan-out/Fan-in • Fanning-out is easy, but fanning-in is more complicated. • Functions offers no help with this scenario today • All the same problems of the previous pattern

Slide 19

Slide 19 text

Fan-Out DEMO

Slide 20

Slide 20 text

Eventing! Event Hub • Receiver polls • Retention up to 7 days • Ability to playback • Big data guy. • Low latency • At least once delivery Event Grid • Sends HTTP to receiver • Distributes (dead-lettering optional, 1 day retry) • No delivery order guarantee • Deeply integrated into Azure. • At least once delivery • Low cost • Serverless

Slide 21

Slide 21 text

Messaging • Service Bus on stage! • Reliable asynchronous message delivery • Requires polling • FIFO, transactions, routing, duplicate detection and so on.

Slide 22

Slide 22 text

When to use what?

Slide 23

Slide 23 text

Why Azure API Management? • Rate limiting • Access Policies • Caching • Subscriptions • Licensing • Analytics • Developer Portal • and so on…

Slide 24

Slide 24 text

Throttling functions with API Management DEMO

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

Further learning… Create serverless applications • https://drn.fyi/3HKvZho Architect message brokering and serverless applications in Azure • https://drn.fyi/3HJz8OB Build serverless, full-stack applications in Azure • https://drn.fyi/3Bis1u6

Slide 31

Slide 31 text

Thanks http://daron.me | @daronyondem Download slides here; http://decks.daron.me