+ All Categories
Home > Documents > Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal...

Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal...

Date post: 22-May-2020
Category:
Upload: others
View: 6 times
Download: 1 times
Share this document with a friend
100
© Betabit Nederland B.V. Rick van den Bosch @rickvdbosch @BetabitNL Welcome to the
Transcript
Page 1: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Rick van den Bosch@rickvdbosch@BetabitNL

Welcome to the

Page 2: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Rick van den Bosch@rickvdbosch@BetabitNL

Time Activity / Session Title

9:30 – 10:15 Guest arrival, Registration, Introduction

10:15 – 12:15 What is Serverless?Microsoft Flow & Azure Logic AppsLAB

12:15 – 13:00 Lunch

13:00 – 14:30 Azure FunctionsLAB

14:30 – 14:45 Break

14:45 – 16:00 Azure EventGridLABOther neat stuff

16:00 – 17:00 Closing Remarks, Questions, Raffle & Guest Departure

Day's Schedule

Page 3: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Rick van den Bosch@rickvdbosch@BetabitNL

What is Serverless?GAB 2018

Page 4: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Agenda

What is Serverless?

Serverless vs. Alternatives

NoOps?

Benefits & Drawbacks

Tools

Page 5: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

What is Serverless?

Does Serverless mean that there are no servers?

Does Serverless mean that there are less servers?

Maybe Serverless is not a great name...

Page 6: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Interest over time

Source:

Page 7: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

About Serverless…

“Serverless is not just a fad or buzzword.

{…}

With serverless, you need only worry about your code and how it is triggered. The platform takes care of the

rest.”

Page 8: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Serverless computing defined

Abstraction of servers

Each invocation could run on a different host

Event-driven scale

Scale is defined by triggers such as

timers, http calls, incoming queue messages etc.

Micro-billing

Only pay for execution and used resource

Focus on appsnot servers

Page 9: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Serverless and Serverless

• Backend as a Service

• Functions as a Service

Page 10: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Backend as a Service

• 3rd party applications / services in the cloud to manage server-side logic and state

• Applications using them were the first to be called Serverless

• Rich client applications (SPA or mobile apps)

Page 11: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

(Mobile) Backend as a Service: Example

Page 12: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Function as a Service

• Server-side logic written by developer

• Run in stateless compute containers

• Event-triggered

• Short-lived

• Fully managed by 3rd party

Page 13: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Functions as a Service: Example

Page 14: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Serverless vs. Alternatives

Page 15: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

IaaS, PaaS & SaaS

IaaS PaaS SaaS

MIGRATE

to it

DEVELOP

on it

CONSUME

it

Page 16: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

As a service?

IaaS PaaS SaaSCaaS FaaSOn Premises

HaaS

Page 17: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

“Most PaaS applications are not

geared towards bringing entire applications

up and down for every request, whereas

Serverless platforms do exactly this. …”

Page 18: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

As a service?

DatacenterHardware as a unit of scale

IaaSOS as a unit of scale

PaaSApplication as a unit of scale

FaaSFunction as a unit of scale

Page 19: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

NoOps?

Page 20: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

NoOps?

• Serverless might mean ‘No internal SysAdmin’

• But Ops still needed for…• Monitoring

• Deployments

• Security

• And the rest (they normally don’t have time for)

Page 21: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Benefits & Drawbacks

Page 22: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Benefits: Costs

• Economy of Scale

• BaaS:• Less development

• Less infrastructure

• Less ops

• FaaS:• Only pay for the compute you need

Page 23: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Benefits: Ops

• Simpler scaling

• Reduced packaging and deployment complexity

• Time to market / experimentation

Page 24: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Drawbacks: Inherent

• Vendor control

• Vendor lock-in

• Multitenancy

• Security concerns

• FaaS == stateless

Page 25: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Drawbacks: Implementation

• Execution duration

• Testing

• Monitoring / Debugging

• Lack of tools & experience

Page 26: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Tools

Page 27: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

First wave

• Many barriers to developer productivity• No debugging support

• No local development experience

• Monitoring was hard

• Serverless became popular despite these downsides

Page 28: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Now

• Tooling and local development experience unique among cloud vendors

• Azure Functions runtime for local development

• Triggering off Azure events (hybrid debugging experience)

• Application Insights integration• Live event stream

• Runtime metrics

• Log custom metrics

• Alerts

Page 29: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Rick van den Bosch@rickvdbosch@BetabitNL

Microsoft Flow & Azure Logic AppsGAB 2018

Page 30: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Agenda

Microsoft Flow

demo

Azure Logic Apps

demo

Page 31: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Microsoft Flow

Page 32: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Flow?

“Microsoft Flow is a product to help you set up

automated workflows between your

favorite apps and services to

synchronize files, get notifications,

collect data, and more.”

Page 33: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Connectors

180+ and counting

Not only Microsoft apps & services

http://bit.ly/dwms-flowconn

Page 34: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Flow templates

Page 35: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Microsoft Flow Pricing

Page 36: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Microsoft Flow Plan Features

Page 37: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Microsoft Flow

Let's code!

Actually, not really...

Page 38: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Azure Logic Apps

Page 39: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Logic Apps?

“Automate the access and use of data

across clouds

without writing code”

Page 40: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Logic Apps!

Out-of-the-box Connect and integrate data B2B and enterprise

Connectors from the cloud to on-prem messaging in the cloud

Take advantage of Tap into Azure Services

BizTalk Server investments

Page 41: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Logic Apps!

Page 42: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Isn’t this just Flow?

• Both are configuration-first integration services

• Flow is built on top of Logic Apps

• Flow is Business oriented, Logic Apps are developer oriented

• Logic Apps are a part of Azure

Flow empowers any office worker to perform simple integrations without going through developers or IT

Logic Apps can enable advanced or mission-critical integrations where enterprise-level DevOps and security practices are required

Page 43: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Flow or Logic Apps?

Page 44: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Example Logic app

Page 45: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Logic Apps Pricing

Page 46: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Azure Logic Apps

Let's code!

Well, almost...

Page 47: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Hands on!

Page 48: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

LAB: Microsoft Flow

Create a flow from a template bit.ly/bbgab18_lab01

Use the Microsoft Flow mobile app bit.ly/bbgab18_lab02

BONUS

Build flows bit.ly/bbgab18_lab03

Work with approvals

Administer flows

Page 49: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

LAB: Microsoft Logic Apps

Create logic apps – Azure Portal bit.ly/bbgab18_lab04Quickstart: Build your first logic app workflow

Create logic apps – Visual Studio bit.ly/bbgab18_lab05Quickstart: Automate tasks and processes with Azure Logic Apps

BONUS

Azure 101 Logic App lab bit.ly/bbgab18_lab06

Page 50: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Rick van den Bosch@rickvdbosch@BetabitNL

Azure FunctionsGAB 2018

Page 51: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Agenda

Azure Functions

demo

Flow, Logic Apps & Functions

Function Extensions

Best Practices

Page 52: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Azure Functions

Page 53: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Azure Functions

Manage apps,

not infrastructure

Develop your way

Bind into services

Page 54: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Features

• Choice of language

• Pay-per-use pricing model

• Bring your own dependencies

• Integrated security

• Simplified integration

• Flexible development

• Open-source

Page 55: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Available triggers

• HTTPTrigger

• TimerTrigger

• GitHub webhook

• Generic webhook

• CosmosDBTrigger

• BlobTrigger

• QueueTrigger

• EventHubTrigger

• ServiceBusQueueTrigger

• ServiceBusTopicTrigger

Page 56: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Available integrations

• Azure Cosmos DB

• Azure Event Hubs

• Azure Event Grid

• Azure Mobile Apps (tables)

• Azure Notification Hubs

• Azure Service Bus (queues and topics)

• Azure Storage (blob, queues, and tables)

• GitHub (webhooks)

• On-premises (using Service Bus)

• Twilio (SMS messages)

Page 57: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Supported bindings

Page 58: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Supported bindings

Page 59: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Running Azure Functions

Consumption plan

When your function runs, Azure provides all of the necessary computational resources. You don't have to worry about resource management, and you only pay for the time that your code runs.

App Service plan

Run your functions just like your web, mobile, and API apps. When you are already using App Service for your other applications, you can run your functions on the same plan at no additional cost.

Page 60: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Routing

Default: http://<yourapp>.azurewebsites.net/api/<funcname>

Page 61: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Routing

Url: http://<yourapp>.azurewebsites.net/api/products/electronics/123

Page 62: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Routing

All functions routes are prefixed with api by default

Can be changed:

Page 63: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Throttling

• maxOutstandingRequestsToo many: 429 Too busy

• maxConcurrentRequestsDefault: unbound

• dynamicThrottlesEnabledChecks system performance countersDefault: false> 80%: 429 Too busy

Page 64: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Limitations

The default timeout for Functions on a Consumption Plan is 5 minutes

Can be increased to 10 minutes

Page 65: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Scaling

Page 66: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Scaling behavior

Can vary on a number of factors

Can scale differently based on trigger and selected language

Constraints:

- Single function app will only scale to a maximum of 200 instances

- Single instance may process more than one message or request at a time(so there’s no set limit on number of concurrent executions)

- New instances will only be allocated at most once every 10 seconds

Page 67: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Dual abstraction

Serverless abstracts away the compute

Bindings abstract away the services you interact with

Page 68: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Functions Pricing

Page 69: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Billing example - Resources

Page 70: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Billing example - Executions

Page 71: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Demo

Let's code!

Finally some real code!

Page 72: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Flow, Logic Apps & Functions

Page 73: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

When do I choose what?

• For simple business optimization, use Flow

• More advanced integration, DevOps need or security compliance, use Logic Apps

• Highly custom transformation or specialized code, use Functions.

Page 74: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Putting it all together

You can…

• … call a logic app in a flow

• … call a function in a logic app

• … call a logic app in a function

“Integration continues to improve.

Any investment you make in

these three technologies is worthwhile.”

Page 75: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Function Extensions

Page 76: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Durable Functions

enables writing long-running, stateful function orchestrations

in code in a serverless environment

• Function Chaining

• Fan-out/Fan-in

• Monitors

• Human Interaction & Timeouts

http://bit.ly/dwms-durable

Page 77: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Binding Extensions

The SDK exposes an extensibility modelthat allows 3rd party extensions to be written

Two main types of binding extensions:

Trigger Bindings

- monitor external event sources

- cause a job function to be executed when they occur

Non-Trigger Bindings

- bindings to an external system Binding extensions

Page 78: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Binding Extension: SlackOutputBinding

Page 79: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Functions Best Practices

Page 80: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Best Practices

Long runningKeep the runtime short (default < 5m; configure to 10m)

StatelessDon’t use state in the host

Idempotent

Cold startFast start up times

Keep them small

Control‘They’ control scaling

‘They’ control when your host is alive

You control the code!

Page 81: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

LAB: Azure Functions

Create a Function in the Azure Portal bit.ly/bbgab18_lab07

Functions with Visual Studio bit.ly/bbgab18_lab08

TEST (the result of lab 08)

Mark Harrison – Colors bit.ly/bbgab18_tst01

BONUS

Build a Serverless app in 30 minutes with bit.ly/bbgab18_lab09

Azure Functions and Logic Apps

Azure Functions Hands-on-Lab (C#) bit.ly/bbgab18_lab10

Page 82: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Rick van den Bosch@rickvdbosch@BetabitNL

Azure Event GridGAB 2018

Page 83: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

What is Azure Event Grid?

Page 84: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Azure Event Grid

Simplify event

consumption

Build reliable

cloud apps

Focus on product

innovation

Page 85: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Azure Event Grid

Uniform event consumptionWith pub-sub

React to events In near-real time

Azure & non-Azure

Easy to build event-based architectures

Page 86: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Azure Event Grid

Events as first-class objects with intelligent filteringFiltering on event type, prefix or suffix

Built to scaleHighly available, handles massive scale automatically

Opens new Serverless possibilitiesEnables event-based scenarios to span new services with ease

Lowers barriers to ops automationEnables simpler operational and security automation

Easier policy enforcement (built-in support for Azure Automation)

Page 87: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Concepts

Events

Event sources

Topics

Event subscriptions

Event handlers

What?

Where?

Anyone?

Where to?

Handle it!

Page 88: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Concepts

Page 89: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Capabilities

SimplicityPoint & click

Advanced filteringEvent type or event publish

Fan-outMultiple endpoints

Reliability24-hour retry, exponential backoff

Pay-per-event€ 0,506 / 1 million operations (first 100K free)

High throughputSupport for millions of events / second

Built-in eventsResource-defined built-in events

Custom eventsLeverage Event Grid features

Page 90: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Pricing example

Page 91: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Pricing example

Page 92: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Pricing example

Page 93: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Event Sources

• Azure Subscriptions (management operations)

• Custom Topics

• Event Hubs

• IoT Hub

• Resource Groups (management operations)

• Service Bus

• Storage Blob

• Storage General-purpose v2 (GPv2)

Page 94: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Event Handlers

• Azure Automation

• Azure Functions

• Event Hubs

• Logic Apps

• Microsoft Flow

• WebHooks

Page 95: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Example usage scenarios

Serverless ArchitecturesTrigger a Logic App when a new blob is uploaded

OperationsListen & react on what happens in your subscription by subscribing to Azure Subscription changes

IntegrationExtend existing workflows by triggering a Logic App once there is a new record in your database

CustomCreate your own by using application topics (aka custom topics)

Page 96: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Reacting to Blob Storage events

Azure CLI

Page 97: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Example uses

Serverless application architectures

Event Grid connects data sources

and event handlers

Ops automation

Event Grid allows you to speed automation and simplify policy enforcement

Application integration

Event Grid connects your app with other services

Page 98: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

LAB: Azure EventGrid

Automate resizing uploaded images using Event Grid bit.ly/bbgab18_lab11

Page 99: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Thanks for attending the

@Betabit Utrecht

Page 100: Welcome to the - Betabit...LAB: Azure Functions Create a Function in the Azure Portal bit.ly/bbgab18_lab07 Functions with Visual Studio bit.ly/bbgab18_lab08 TEST (the result of lab

© Betabit Nederland B.V.

Resources

Azure Logic Apps Tools for Visual Studio 2017Azure Architecture Center

https://mva.microsoft.comhttps://azurecitadel.github.io/


Recommended