Azure Web Jobs

25
Sponsored & Brought to you by Azure WebJobs Steef-Jan Wiggers https://twitter.com/steefjan https://www.linkedin.com/in/steefjan

Transcript of Azure Web Jobs

Page 1: Azure Web Jobs

Sponsored & Brought to you by

Azure WebJobs

Steef-Jan Wiggers

https://twitter.com/steefjan

https://www.linkedin.com/in/steefjan

Page 2: Azure Web Jobs

Steef-Jan WiggersMicrosoft Integration Consultant• Microsoft Azure MVP• Published Author• (Inter)national Speaker• TechNet Wiki Author• Blogger• Forums• Runner• 12th Man

DutchWorkz B.V.

Page 3: Azure Web Jobs

Agenda• What are WebJobs?• How do you create WebJobs?• How do you deploy them?• Kudu• WebJobs SDK• Real world• What else?• Wrap up

Page 4: Azure Web Jobs

What are WebJobs?• 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 5: Azure Web Jobs

WebJob – Console App Demo

Page 6: Azure Web Jobs

How are they stored and started?WebJobs are stored within the website• Site\wwwroot\App_Data\jobs\{job_type}\

{job_name}

Started in the portal or on-demand

Page 7: Azure Web Jobs

Many Options for Deploying• Azure Portal• Visual Studio• Visual Studio Team Services – Build• FTP• Dropbox• Drag-n-drop in Kudu• Others …

Page 8: Azure Web Jobs

Publish WebJobs

Page 9: Azure Web Jobs

Connection

Page 10: Azure Web Jobs

Settings

Page 11: Azure Web Jobs

Deploy

Page 12: Azure Web Jobs

Kudu• Engine behind git deployments and WebJobs• Can be run outside of Azure• Provides dashboard functionality for a website

Project Sitehttps://github.com/projectkudu/kudu

Page 13: Azure Web Jobs

Paths & FilesFile/Pathdisable.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 logstatus_{hash} Status fileWebJobsSDK.marker Singleton lock file

Page 14: Azure Web Jobs

Kudu Demo

Page 15: Azure Web Jobs

WebJob SDK• 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 16: Azure Web Jobs

WebJob SDK – Triggers and Bindings• Queues (Storage and ServiceBus)• Blobs• TablesProject Site:https://github.com/Azure/azure-webjobs-sdk

• Now as Microsoft.Azure.WebJobs NuGet

Page 17: Azure Web Jobs

Real world scenario - 1Push customer data to Redis Cache

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

Inbound

Web Job

Azure cache(REDIS)

Page 18: Azure Web Jobs

Real world scenario (POC)- 2MPR Data parser

.VEE filesEDI format

MPR

WebJob(Parsing)

EDI to JSON

Storage blob

Push

Storage blob

Page 19: Azure Web Jobs

WebJobs In Action Demo

Page 20: Azure Web Jobs

WebJob SDK Extensions• TimerTrigger• FileTrigger• SendGrid• ErrorTrigger• WebHooksProject Site:https://github.com/Azure/azure-webjobs-sdk-extensions

Page 21: Azure Web Jobs

Alternatives• Azure Functions

• Server less coding• Configuration

• Azure Logic Apps• Configuration• Custom API

Page 22: Azure Web Jobs

LogicApp Demo

Page 23: Azure Web Jobs

Wrap up• Flexible means of task automation• Scalable• Mature• Kudu• SDK

Page 24: Azure Web Jobs

Resources• Azure WebJobs resources: http://bit.ly/1KdUkIH• https://github.com/Azure/azure-webjobs-sdk-samples