Web app job and functions - TUGAIT 2017

41
TUGA IT 2017 LISBON, PORTUGAL WebApp, Jobs and Functions STEEF-JAN WIGGERS

Transcript of Web app job and functions - TUGAIT 2017

Page 1: Web app job and functions  - TUGAIT 2017

TUGA IT 2017LISBON, PORTUGAL

WebApp, Jobs and Functions

STEEF-JAN WIGGERS

Page 2: Web app job and functions  - TUGAIT 2017

THANK YOU TO OUR

SPONSORS

Page 3: Web app job and functions  - TUGAIT 2017

PARTICIPATING

COMMUNITIES CLOUD PRO PT

Page 4: Web app job and functions  - TUGAIT 2017

The best!

Page 5: Web app job and functions  - TUGAIT 2017
Page 6: Web app job and functions  - TUGAIT 2017

Agenda

• WebApp, Job and Functions

• Deployment

• Kudu

• Functions

• Real World Scenarios

• Considerations

• Wrap up

Page 7: Web app job and functions  - TUGAIT 2017

Anatomy of WebJob and Functions

WebAppWebJob

1 .. n 1 .. n

Function

FunctionFunction App

1 .. n

Page 8: Web app job and functions  - TUGAIT 2017

• Languages and Framework

• Superior DevOps

• Self served

• Something else

Apps

Web Apps Mobile Apps API Apps Functions

eCommerce Digital Global Presence LOB API / Services / ISVCustom Apps

App Service

• Limitless/Auto

• OS and Framework

• Load balance

• Something else

• Enterprise grade SLA

• Secure and Compliance

• On-Premise Connectivity

• Something else

Page 9: Web app job and functions  - TUGAIT 2017

Built around app service• Runs on existing App Hosting plans

• Run alongside Web, Mobile, and API Apps• Can deploy via existing App Service ARM APIs

• All the features of App Service• Continuous Deployment• Deployment Slots• Remote Debugging

• Run in your own isolated and dedicated environment• App Service Environment helps run dedicated App Services• Run inside of your own VNET, with your own frontend and firewall

Page 10: Web app job and functions  - TUGAIT 2017

WebJob

• Flexible way to run background jobs

• Can be .cmd, .bat, .exe, .ps1, .sh, .php, .py, .js, .jar

• Execution options: continuous, on demand, scheduled

• Can scale with your website

Page 11: Web app job and functions  - TUGAIT 2017

Function

Page 12: Web app job and functions  - TUGAIT 2017

Languages

• 1st class support• Node/JavaScript

• C#

• Experimental support• F#

• Python

• PHP

• Batch

• Bash

• PowerShell

Page 13: Web app job and functions  - TUGAIT 2017

Azure Function Architecture

FunctionsRuntime

Functions Programming

Interface

App Service App Hosting Plans

Triggers

Input Bindings

Output Bindings

Page 14: Web app job and functions  - TUGAIT 2017

Scale!!!

Page 15: Web app job and functions  - TUGAIT 2017

Demo

Page 16: Web app job and functions  - TUGAIT 2017

Deployment

• Azure Portal

• Visual Studio

• Visual Studio Team Services – Build

• FTP

• Dropbox

• Drag-n-drop in Kudu

• Others …

Page 17: Web app job and functions  - TUGAIT 2017

Publish WebJobs or Functions

Page 18: Web app job and functions  - TUGAIT 2017

Connection

Page 19: Web app job and functions  - TUGAIT 2017

Setting

Page 20: Web app job and functions  - TUGAIT 2017

Deploy

Page 21: Web app job and functions  - TUGAIT 2017

Kudu

• Engine behind git deployments and WebJobs

• Can be run outside of Azure

• Provides dashboard functionality for a website

Project Site

https://github.com/projectkudu/kudu

Page 22: Web app job and functions  - TUGAIT 2017

Paths & FilesFile/Path

disable.job Existence of file stops the job. Deleting it starts the job.

settings.job Allows you to indicate: is_singleton to scale with website.{ “is_singleton”: true } or { “is_singleton”: false }

site\wwwroot\App_Data\jobs\continuous Path for continuous web jobs

site\wwwroot\App_Data\jobs\triggered Path for on demand and scheduled web jobs

data\jobs Data directories for jobs

job_log.txt Text file of web job log

status_{hash} Status file

WebJobsSDK.marker Singleton lock file

Page 23: Web app job and functions  - TUGAIT 2017

Demo - Kudu

WebAppWebJob

1 .. n 1 .. n

Function

FunctionFunction App

1 .. n

KUDU

Page 24: Web app job and functions  - TUGAIT 2017

Function triggers

• A method can be “triggered” by some event

• Route parameters and bindings help simplify inputs and outputs

• A few options for logging that surface information in the Azure Portal

Page 25: Web app job and functions  - TUGAIT 2017

Function – Trigger and bindingsType Service Trigger Input Output

Schedule Azure Functions ✔

HTTP (REST or webhook)

Azure Functions ✔ ✔*

Blob Storage Azure Storage ✔ ✔ ✔

Events Azure Event Hubs ✔ ✔

Queues Azure Storage ✔ ✔

Queues and topics Azure Service Bus ✔ ✔

Tables Azure Storage ✔ ✔

Tables Azure Mobile Apps ✔ ✔

No-SQL DB Azure DocumentDB ✔ ✔

Push Notifications Azure Notification Hubs

Twilio SMS Text Twilio ✔

Page 26: Web app job and functions  - TUGAIT 2017

Functions – Proxies (preview)

• Specify endpoint for other resources

WebAppWebJob

1 .. n 1 .. n

Function

FunctionFunction App

1 .. nProxies

Page 27: Web app job and functions  - TUGAIT 2017

Demo

Page 28: Web app job and functions  - TUGAIT 2017

Real world scenario - 1

• Push customer data to Redis Cache

Inbound

Web Job

Azure cache

(REDIS)

Self-Service Portal

API Management

Outbound Inbound

WebAPI WebAPI

VIP

Web Job

Azure cache

(REDIS)

To Redis

Storage (Azure)

Web Job Dashboard

Administrator/Developer Portal

DatastoreNuon

(Windows) Service (Windows) Service

Page 29: Web app job and functions  - TUGAIT 2017

Real world scenario - 2

• MPR Data Parser

.VEE filesEDI format

MPR

WebJob(Parsing)

EDI to JSON

Storage blob

Push

Storage blob

Page 30: Web app job and functions  - TUGAIT 2017

Real world scenario – 3

• Sync All WebJob

WebJobsLMS365 API Logic Apps

Dynamics CRM

Online

Page 31: Web app job and functions  - TUGAIT 2017

WebJob - Demo

.VEE filesEDI format

MPR

WebJob(Parsing)

EDI to JSON

Storage blob

Push

Storage blob

Page 32: Web app job and functions  - TUGAIT 2017

Trigger Extensibility

• TimerTrigger

• FileTrigger

• SendGrid

• ErrorTrigger

• WebHooks

• Project Site:

https://github.com/Azure/azure-webjobs-sdk-extensions

Page 33: Web app job and functions  - TUGAIT 2017

Considerations

• Logic App depending on workload:• Big workloads, processing WebJobs

• Specific processing Functions

• Connectivity, process Logic Apps, Flow

• Schedule

• Standalone

• Security

WebAppWebJob

1 .. n 1 .. n

Function

FunctionFunction App

1 .. n

Visual Studio

Visual Studio / Browser

Page 34: Web app job and functions  - TUGAIT 2017

Azure Logic Apps

• Faster integration using innovative Visual Designer

• Easy workflow creation with triggers and actions

• Mashup applications, data and services

• Built for mission critical Enterprise Integration

• Create, deploy, manage and monitor

Page 35: Web app job and functions  - TUGAIT 2017

Demo

Logic App

Function

Cognitive Service APITekst Analysis

good

moderate

bad

Tweets with hashtag #trump

Post Tweet Body and Tweeted By

Evaluate score

Send tweet text

IF THAT THEN THIS AND MORE….

Page 36: Web app job and functions  - TUGAIT 2017

Competitions

Page 37: Web app job and functions  - TUGAIT 2017

Wrap up

• Flexible means of task automation

• Scalable

• Mature

• Kudu

• Workloads

• Developer experience

• DevOps

Page 38: Web app job and functions  - TUGAIT 2017

Resources• Azure WebJobs resources: http://bit.ly/1KdUkIH

• https://github.com/Azure/azure-webjobs-sdk-samples

• Azure WebJobs: ServiceBusTrigger

• Azure Functions: https://azure.microsoft.com/en-us/services/functions/

• Azure Functions Docs: https://docs.microsoft.com/en-us/azure/azure-functions/functions-overview

• Serverless functions: https://github.com/serverless/serverless-azure-functions

Page 39: Web app job and functions  - TUGAIT 2017

Want to connect?

@SteefJan

[email protected]

Steef-Jan Wiggers

Page 40: Web app job and functions  - TUGAIT 2017

PLEASE FILL IN EVALUATION

FORMSFRIDAY, MAY 19th SATURDAY, MAY 20th

https://survs.com/survey/cprwce7pi8 https://survs.com/survey/l9kksmlzd8

YOUR OPINION IS

IMPORTANT!

Page 41: Web app job and functions  - TUGAIT 2017

THANK YOU TO

LISTENING

Questions anyone?