Saturday 16 February 2013

Azure Scheduler Service- To be…..

 

In a business application there are lot of features which need to be executed on a scheduled basis may be one time or recurrent. The need of a scheduler service on cloud is imperative.I realized the need of a scheduler service some what on the lines of Windows Scheduler is bare metal. We started with a little bit of R&D and found the Quartz framework was suitable for the job. After some hunting around I’d get to understand MSFT has to / finally planning on bringing  out Azure Scheduler Services. In this post I talk about what may MSFT plan to bring out in the coming months around Azure Scheduler Services. Azure Scheduler Service is indeed a CRON service running on Azure. A lot of place I have thought from an architecture stand point as I have walk down this part with Quartz.

What is Azure Scheduler Service- A Platform service that allows users a way to schedule an action or recurring action in relation to any other service in cloud example “Call my check order delivered service every 30 mins, or check if my worker roles are responding every few minutes or Check if the third party gateway service is running.”

Where does it fit in the overall Azure Platform?

As always an important feature like scheduler services can apply to multiple artefacts on azure the website, web role, queues, mobile services. So one would expected a more integrated experience out of the Azure Management Portal.

Azure Scheduler Services are likely to be configured directly from the portal and a API interface for the same also will be provided. From a high level features point of view

  • Can schedule a job one time or recurring
  • Can execute actions such as “invoking a service in/out of Azure platform”. Reliable by nature will multiple retry policy. Security will be inbuilt and well integrated with ACS.
  • Every scheduler will have an  custom exception path. This will be  in the form of logging, email or notification.
  • Overall scheduler lifecycle management will be provided
  • Archival of schedule events.

What can / probably the Portal Scheduler experience look like?

From a portal experience one can expect setting the following parameters

  • Action Details
    • HTTP Method to call , if it is SSL and the method POST or GET.
    • URL Name
    • If Secure then header details
  • On Exception
    • Send Notification to via email, url, sms etc..
  • Scheduler Interface will be fairly straightforward
    • Date, Time, Time Zone
    • Single to Recurring & Recurrence Pattern
    • Recur Until i.e no of times or occurrence or a date

What does a Job Involve?

Quite sure the Job definition will JSON based.

  • Action Details-Action that is invoked on each occurrence and describe 
    • Type  of service invocation. The service endpoint can be HTTP/S
    • Richer experience support such as Send Mail
    • Post to a Queue(Azure or SB Queue)
    • Custom Code execution.

example of an Action Detail, JSON based

“action”{ “type”: “http”, “request”

                {

                    “uri”: “http://bill.cloudapp.net/GetCatalog/Simple”,

                     “method”: “GET”,

                    “header”:

                    {

                         “Content – Type”; “xml”

                   },

                  “secureHeader “:

                    {

                             “acs-auth-manager”: “<billapp>”

 

                    }

                 “body”:{

                  }

          }

} 

  • Recurrence Schedule: This is likely to be very similar to the Outlook Appointment with a starttime, frequency unit, period, prescribed schedule, completion rule
  • Exception Handler:  This is the action that gets invoked when the primary handler fails. It involves the following
    • Exception handler endpoint
    • Send a user notification via email, sms or azure.
    • Custom Code

This is end point which is expected to be more reliable. The exception handling is exponential by nature.

  • Metadata – This will be more likely a query services which will allow to query on the collection on the scheduled jobs. The query can be on
    • State of a Job (“Running, Stalled, Completed”)
    • Attributes: Set of name value pair which identifies the job

Example:

“state”: “completed”

“metadata”:

{

         “app”: “Shoe Catalogs”

}

Can the Scheduler be paused, stopped , changed?

The Jobs will have options to be stopped , paused, resume, deleted and changed.

Does the job have transient fault handling capabilities?

Given the very nature of cloud transient fault handling is a must.It’s likely to have a retry count.

What is current already there on the Azure Platform?

  As of today there Mobile Services which have scheduled scripts. The Azure Scheduler Services is actually supporting this in the back end. The Mobile Services Scheduled Scripts involve polling third party services on a time based for push notification and much more. This will be reused across the platform.

What can we see in coming months on Scheduler Services?

  • Integrated Experience- As an architect I tend to think of features have an integrated experiences across the azure portal. The Mobile Service Scheduled scripts is already a party of preview, we are likely to see similar jobs in websites, web role most likely to integrated experience.
  • Rich Actions:The actions needs to get richer in terms running custom code, or on an recurring basis please go recycle my vm, or clean up my cache or execute a query against sql azure.
  • Multi Action: We often see that an action has 1:1 relationship with the job. There may be a need to run the actions against multiple targets example: Run my sql query against 5 database located across the globe.
  • Sequenced Actions:  An action may involve multiple calls to execute the job. For example the service endpoint may require to get some data from some other service and then execute the service endpoint.

Is there API for the Scheduler Services?

API will be required.

What is lower time of the frequency?

The lowest time frequency is likely to be 10 seconds.

Does this integrated with Azure Workflow Manager ?

Yes it will integrate with Workflow Manager via service endpoint.

When can one see Azure Scheduler Service expected to be in preview?

The preview most likely be available mid year 2k13 or earlier in preview.

Does Amazon have the scheduler services?

No.