List of all posts from this series: http://vunvulearadu.blogspot.ro/2014/11/azure-blog-post-marathon-is-ready-to.html
Short Description
Azure Schedulers is a service that can be used with success when we have recurrent actions that we want to run at a specific time interval (every few minutes, every few hours, days and so on).
This is a multi-tenant service that is offered by Microsoft and is quaranteed to run even in a case of network or hardware failure.
Main Features
REST API
As you already observed, all the services offered by Azure, including this one is can be configured and accessed over a HTTP, using a REST API.
Job ad Job Collections
In Azure Scheduler terminology a Job is a recurrent task or action. A job collections is a group of jobs that are grouped together.
History
We have the ability to see the history of the jobs that were run by scheduler. How each trigger action ended and so on.
Job Action
For each job that we schedule we need to specify the action that we want to perform. The job action can be represented by:
We have the ability to specify a secondary endpoint that can be used when the call to the first endpoint fails. Can be used with success if want to send a notification that the trigger calls failed.
Start Time
For each job we can specify the start time. This can be useful when we create the initial setup and we don’t want to start to trigger immediately our custom actions.
Recurrence
When we configure how often a specific job to be executed, we can specify the frequency as time interval or as time. On top of this we have the ability to specify how many time we want to execute our trigger (1 time, 10 times, 1000 times and so on).
When we create a job we can create a job that will not be recurrent (one time job). For the one that are recurrent we can specify not only the recurrence level but also:
State
Each job can have 4 states, which can be controlled by user not only by the system:
Retry Policy
This is a pretty interesting option. We have the ability to specify the retry policy that should be applied if the job fails to run. Be By default this feature is not activated. To be able to activate it we need to specify the retry time interval and retry count.
Authentication
We have the ability to use Client Certificate authentication or our endpoints. To be able to do this we need to specify the authentication node when we create a job. In it we will need to add the pfx content and password of course.
Beside this, we can use authentication that is based on username and password (basic authentication).
Limitations
Maximum Recurrence Time
The maximum recurrence time that is allowed is 18 month. From my perspective this is acceptable. The same limit exist on the start time.
Frequency
For standard jobs is 1 minutes. For the free one is 1 hours.
Maximum number of jobs
For the standard version it is 50 jobs. For the free one you can create maximum 5 jobs in the same collection. If you end up with more than 50 jobs, than you can create more than one job collections.
Also, we have the ability to use the Premium unit not the standard one where we can create 10.000 jobs collection. This mean that using Premium option we can have 500.000 jobs for only ~104e.
Applicable Use Cases
In this section you will discover 4 use cases when I would use Azure Scheduler.
Facebook post processing
Let’s imagine that we have a service that at specific time interval takes all the posts of a user and select the most important one and send them as notification to the end user. For this use case we would need to trigger the processing action at a specific time interval. For this purpose we could use with success Azure Scheduler.
Daily Cleanup
Every big and ugly system is a ‘state of the art’. Because of this we need to run a cleanup process every day at a specific time interval. The trigger of this cleanup task can be made by Azure Scheduler.
Logs Processing
Yes, there are logs that are analyzed in real time, but in the same time, we have every few hours or days to take all the logs, apply same magic over there, and archive them and so on. As in the above use case, the trigger for this job can be Azure Scheduler.
Special Offers
Imagine that you have a system that at a specific time interval add a new product in the special offer section. This push can could be triggered by Azure Scheduler.
Code Sample
There are not too much code that I could show here, but below you can find the JSON that is used to specify authentication data.
Pros and Cons
Pros
Cons
Pricing
If you are thinking to use Azure Scheduler you should take into account:
Conclusion
It is a service that is very simple to use. On top of this, is reliable and very scalable. It can be used with success in many scenarios. It one of the services from Azure that can make a difference on the quality of your products and services.
Short Description
Azure Schedulers is a service that can be used with success when we have recurrent actions that we want to run at a specific time interval (every few minutes, every few hours, days and so on).
This is a multi-tenant service that is offered by Microsoft and is quaranteed to run even in a case of network or hardware failure.
Main Features
REST API
As you already observed, all the services offered by Azure, including this one is can be configured and accessed over a HTTP, using a REST API.
Job ad Job Collections
In Azure Scheduler terminology a Job is a recurrent task or action. A job collections is a group of jobs that are grouped together.
History
We have the ability to see the history of the jobs that were run by scheduler. How each trigger action ended and so on.
Job Action
For each job that we schedule we need to specify the action that we want to perform. The job action can be represented by:
- A HTTP/S request (we can specify the call method – GET, PUT, POST, DELETE)
- Storage Queue Message
We have the ability to specify a secondary endpoint that can be used when the call to the first endpoint fails. Can be used with success if want to send a notification that the trigger calls failed.
Start Time
For each job we can specify the start time. This can be useful when we create the initial setup and we don’t want to start to trigger immediately our custom actions.
Recurrence
When we configure how often a specific job to be executed, we can specify the frequency as time interval or as time. On top of this we have the ability to specify how many time we want to execute our trigger (1 time, 10 times, 1000 times and so on).
When we create a job we can create a job that will not be recurrent (one time job). For the one that are recurrent we can specify not only the recurrence level but also:
- Starting time
- Ending time
State
Each job can have 4 states, which can be controlled by user not only by the system:
- Enabled – Active
- Disabled – Inactive
- Completed
- Faulted
Retry Policy
This is a pretty interesting option. We have the ability to specify the retry policy that should be applied if the job fails to run. Be By default this feature is not activated. To be able to activate it we need to specify the retry time interval and retry count.
Authentication
We have the ability to use Client Certificate authentication or our endpoints. To be able to do this we need to specify the authentication node when we create a job. In it we will need to add the pfx content and password of course.
Beside this, we can use authentication that is based on username and password (basic authentication).
Limitations
Maximum Recurrence Time
The maximum recurrence time that is allowed is 18 month. From my perspective this is acceptable. The same limit exist on the start time.
Frequency
For standard jobs is 1 minutes. For the free one is 1 hours.
Maximum number of jobs
For the standard version it is 50 jobs. For the free one you can create maximum 5 jobs in the same collection. If you end up with more than 50 jobs, than you can create more than one job collections.
Also, we have the ability to use the Premium unit not the standard one where we can create 10.000 jobs collection. This mean that using Premium option we can have 500.000 jobs for only ~104e.
Applicable Use Cases
In this section you will discover 4 use cases when I would use Azure Scheduler.
Facebook post processing
Let’s imagine that we have a service that at specific time interval takes all the posts of a user and select the most important one and send them as notification to the end user. For this use case we would need to trigger the processing action at a specific time interval. For this purpose we could use with success Azure Scheduler.
Daily Cleanup
Every big and ugly system is a ‘state of the art’. Because of this we need to run a cleanup process every day at a specific time interval. The trigger of this cleanup task can be made by Azure Scheduler.
Logs Processing
Yes, there are logs that are analyzed in real time, but in the same time, we have every few hours or days to take all the logs, apply same magic over there, and archive them and so on. As in the above use case, the trigger for this job can be Azure Scheduler.
Special Offers
Imagine that you have a system that at a specific time interval add a new product in the special offer section. This push can could be triggered by Azure Scheduler.
Code Sample
There are not too much code that I could show here, but below you can find the JSON that is used to specify authentication data.
"authentication": {
"type": "clientcertificate",
"password": "1234",
"pfx": "pfxKey”
}
Pros and Cons
Pros
- Scalable
- Ability to specify at a very small granular level the recurrence time interval
- HTTPS support
- Retry policy
Cons
- -
Pricing
If you are thinking to use Azure Scheduler you should take into account:
- The number of jobs and how often will run (based on this you can use the Free, Standard or Premium unit)
- Outbound traffic (if applicable)
Conclusion
It is a service that is very simple to use. On top of this, is reliable and very scalable. It can be used with success in many scenarios. It one of the services from Azure that can make a difference on the quality of your products and services.
Comments
Post a Comment