Top Banner
27

! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Dec 24, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",
Page 2: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Kevin LamPrincipal Program ManagerScheduling jobs in the cloud with Azure Scheduler service

Scheduling jobs in the cloud with Azure Scheduler Service

3-620

Page 3: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Overview

REST API & Capabilities

Demo

Scheduling in Azure

Agenda

Page 4: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Scheduler Illustrated

Job

On-Prem Service

Cloud Hoster

Web Service

Relay

Jobs

History

Create Job

Get Job History

Windows Azure

Web Service

HTTP

Azure Scheduler

Page 5: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Scheduler Capabilities Overview

Management

•REST API•.NET Client•PowerShell•Portal Experience

Actions• HTTP &

Storage Queue Actions

• Error Handler

• Configurable Retry

Scheduling

•Fire once•Simple recurrence•Complex schedule

Monitoring

•Execution History

Page 6: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Geo-redundant service deployment

Geo-regional job replicationServiceHigh Availability Schedul

erNorth

Central US

Scheduler

South Central US

Job replication

Page 7: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Configurable Retry Policy

Alternate endpoint configurabilityJob

Reliability

AtlantaWeb Service(Secondary)

Jobs

History

New YorkWeb Service

(Primary)retryPolicy

Azure Scheduler

Page 8: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Scheduler REST API and Capabilities

Page 9: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

REST RESTful API for managing Scheduler resources

Service Management API as Proxyhttps://management.core.windows.net/{subid}/cloudservices/{csname}/resources/scheduler/~/jobcollections/{jcname}/jobs/{jobname}

Inbound Security Authentication using subscription certificate

REST API

Page 10: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Entity Hierarchyhttps://management.core.windows.net/{subid}/cloudservices/{csname}/resources/scheduler/~/jobcollections/{jcname}/jobs/{jobname}/history jobcollections jobs history

Job Collections

Jobs History

Job

Page 11: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Azure Resource Created by the subscription owner

Unit of Organization or Management Can group jobs together based on usage or application boundaries Constrained to a region

Quotas Can apply quotas to constrain the usage of all jobs in that collection

{MaxJobs, MaxRecurrence}

URIhttps://management.core.windows.net/{subid}/cloudservices/{csname}/resources/scheduler/jobcollections/{jcname}

Job Collections Job Collections

jobcollections

Page 12: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

JSON DefinitionActionError ActionRetry PolicyRecurrenceState Secure

Action is encrypted at rest

URIhttps://management.core.windows.net/{subid}/cloudservices/{csname}/resources/scheduler/~/jobcollections/{jcname}/jobs/{jobname}

Jobs Jobs

jobs

Page 13: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Describes a type of service invocation Call HTTP/s endpoint Post to a storage queue

Invoked on each occurrence

Job Action Job

Page 14: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Storage Queue with SAS Token Min privilege (add message access permission) Can be revoked and can expire

HTTPS Web Request with Basic Auth Add Base64 encoded username:password to Authorization header

"headers": { “Authorization": “Basic QWxhZGRpbjpvcGVulHNlc2FtZQ==“ }

HTTPS Web Request with Shared Secret Create secret such as a hash of the job URI + shared secret Add to custom security header Server verifies the security header such that the shared secret matches

Job Authentication Job

Page 15: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Start time Date-time for the first occurrence

Frequency One of minute, hour, day, week, month

Interval Interval at the given frequency for the recurrence

Prescribed schedule Specify minutes, hours, weekdays, month days of the recurrence

Completion Rule Count of occurrences End date

Recurrence schedule Job

Page 16: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Retry Policy Override the default retry policy with a different recurrence and count

or set it to ‘none’

Action invoked when primary action fails Call an error handling endpoint Call an alternative available endpoint for job reliability (endpoint high

availability)

Error Handling Job!

Page 17: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

{ "action": { "type": "http", "request": { "uri": "http://my.cloudapp.net:8000/ItemService/GetTweets", "method": "GET", "headers": { "Content-Type": "text/plain", "x-myapp-auth": "<MYAPP_TOKEN>" }, },

// Call Contoso error endpoint if the main action has an error "errorAction": { "type": "http", "request": { "uri": "http://contoso.com/error", "method": "POST", "body": "Scheduler error", "header": { "Content-Type": "application/json" } } },

Putting it all together "retryPolicy": { "retryType": "fixed", "retryInterval": "PT1H", "retryCount": 5 }, }, "state": "enabled",

// Starting Friday occur on the last Friday of every month this year at 8:30am and 5:30pm "startTime": "2014-01-30T12:08:00-08:00", "recurrence": { "frequency": "month", "unit": 1, "endTime": "2014-12-31T23:00:00", "schedule": { "minute": 30, "hour": [8,17], "weekday": [ {"day": "friday", "monthlyOccurrence": -1} ] } },}

Page 18: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

{ "action": { "type": "http", "request": { "uri": "http://bing.com", "method": "GET", "headers": {} } }}

Simple Job

Page 19: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Shows the result of job occurrences Execution status, start time, end time, response, …

Filter on execution status Last 2 months of job occurrences URIhttps://management.core.windows.net/{subid}/cloudservices/{csname}/resources/scheduler/~/jobcollections/{jcname}/jobs/{jobname}/history

History History

history

Page 20: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Demo

West US Backend(Secondary)

Jobs

History

Azure Scheduler

East US Backend(Primary)

Storage Queue Action

Storage Queue Action

Blob Store

Page 21: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Mobile Services Scheduled Scripts Run custom JavaScript as custom business logic on a schedule

Websites Scheduled WebJobs Run custom jobs (running executables or scripts) on a schedule

Azure Management Scheduling Scheduled AutoScaling Scheduled Website Backup Scheduled SQL Azure Database Backup

Azure Services Powered by Azure Scheduler

Page 22: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Backend scheduled workloads Xbox Video

Scheduling video publication content checks

Skype Data Scheduling Hadoop jobs for data analysis

Enabling scheduling capabilities GoFormz

Scheduled forms reports

Partners and Customers Powered by Azure Scheduler

Page 23: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Mobile Services Scheduled Scripts Effect data within the mobile service

Websites Scheduled WebJobs Effect data or processing within the website Simple way to host lightweight job on an existing website

Schedule Jobs Pre-existing endpoint Invoke workloads on other services (e.g., HDInsight with WebHCat) Invoke heavier workloads on worker roles using a storage queue

Scheduling Options in Azure

Page 24: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Channel 9 Cloud Cover episode Episode 127: Windows Azure Scheduler

http://channel9.msdn.com/Shows/Cloud+Cover/Episode-127-Windows-Azure-Scheduler

Channel 9 Azure Friday episodes Azure Scheduler 101 – Kevin Lam explains how to schedule stuff

http://channel9.msdn.com/Shows/Windows-Azure-Friday/Azure-Scheduler-101-Kevin-Lam-explains-how-to-schedule-stuff

Azure Scheduler 102 – Kevin Lam on strange or unusual schedules http://

channel9.msdn.com/Shows/Windows-Azure-Friday/Azure-Scheduler-102-Kevin-Lam-on-strange-or-unusual-schedules

Azure Scheduler 103 – Kevin Lam on the internals and details behind scheduled jobs http://

channel9.msdn.com/Shows/Windows-Azure-Friday/Azure-Scheduler-103-Kevin-Lam-on-the-internals-and-details-behind-scheduled-jobs

Resources

Page 25: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Live recording of John Gruber’s podcast: The Talk Show

TODAY 4:30 pm 2nd floor Press Room (2000)

Space is very limited so please arrive on time Drinks and apps will be served

The Talk Show

Page 26: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

Your Feedback is Important

Fill out an evaluation of this session and help shape future events.

Scan the QR code to evaluate this session on your mobile device.

You’ll also be entered into a daily prize drawing!

Page 27: ! { "action": { "type": "http", "request": { "uri": ", "method": "GET",

© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.