web app job and functions - tugait 2017
TRANSCRIPT
TUGA IT 2017LISBON, PORTUGAL
WebApp, Jobs and Functions
STEEF-JAN WIGGERS
THANK YOU TO OUR
SPONSORS
PARTICIPATING
COMMUNITIES CLOUD PRO PT
The best!
Agenda
• WebApp, Job and Functions
• Deployment
• Kudu
• Functions
• Real World Scenarios
• Considerations
• Wrap up
Anatomy of WebJob and Functions
WebAppWebJob
1 .. n 1 .. n
Function
FunctionFunction App
1 .. n
• 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
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
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
Function
Languages
• 1st class support• Node/JavaScript
• C#
• Experimental support• F#
• Python
• PHP
• Batch
• Bash
• PowerShell
Azure Function Architecture
FunctionsRuntime
Functions Programming
Interface
App Service App Hosting Plans
Triggers
Input Bindings
Output Bindings
Scale!!!
Demo
Deployment
• Azure Portal
• Visual Studio
• Visual Studio Team Services – Build
• FTP
• Dropbox
• Drag-n-drop in Kudu
• Others …
Publish WebJobs or Functions
Connection
Setting
Deploy
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
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
Demo - Kudu
WebAppWebJob
1 .. n 1 .. n
Function
FunctionFunction App
1 .. n
KUDU
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
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 ✔
Functions – Proxies (preview)
• Specify endpoint for other resources
WebAppWebJob
1 .. n 1 .. n
Function
FunctionFunction App
1 .. nProxies
Demo
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
Real world scenario - 2
• MPR Data Parser
.VEE filesEDI format
MPR
WebJob(Parsing)
EDI to JSON
Storage blob
Push
Storage blob
Real world scenario – 3
• Sync All WebJob
WebJobsLMS365 API Logic Apps
Dynamics CRM
Online
WebJob - Demo
.VEE filesEDI format
MPR
WebJob(Parsing)
EDI to JSON
Storage blob
Push
Storage blob
Trigger Extensibility
• TimerTrigger
• FileTrigger
• SendGrid
• ErrorTrigger
• WebHooks
• Project Site:
https://github.com/Azure/azure-webjobs-sdk-extensions
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
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
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….
Competitions
Wrap up
• Flexible means of task automation
• Scalable
• Mature
• Kudu
• Workloads
• Developer experience
• DevOps
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
Want to connect?
@SteefJan
Steef-Jan Wiggers
PLEASE FILL IN EVALUATION
FORMSFRIDAY, MAY 19th SATURDAY, MAY 20th
https://survs.com/survey/cprwce7pi8 https://survs.com/survey/l9kksmlzd8
YOUR OPINION IS
IMPORTANT!
THANK YOU TO
LISTENING
Questions anyone?