User Scheduled Jobs in Azure - azure

We have a requirement for generating reports based on a schedule. These schedules can be configured by the users for a report. Initially We were planning to use Quartz in a worker role and Create jobs based on the user input.
I'm not sure whether the Azure Scheduler can be used for this because I feel any jobs that could run at the application level could be configured in Azure but not the user jobs.
Please validate and let me know if there are any resources which I could look at.

How about using Azure Web Jobs?
(https://learn.microsoft.com/en-us/azure/app-service/web-sites-create-web-jobs)
Can you please explain more about the nature of reports you're running?

Related

Azure Service that can schedule my API calls in AKS

I have this .NET long running API process/function that usually runs 30 mins in one execution that is hosted in AKS. This API is usually executed from the users coming from the front end of the app.
Due to concurrent executions from users, this is causing exhaustion of the app so I'm planning to implement a some sort of a queueing mechanism with the help of a scheduler(s).
What possibly is applicable Azure service that can execute my API in AKS on a scheduled basis (let's say every minute) and possibly check the database for some flagging values.
I need a way to check the table for some flagging value if there a currently running process or its been completed so it can process the next one, otherwise ignore the call until current on is complete.
I was looking into Azure Web Apps, Web Jobs or Batch Jobs but kinda confused which is applicable with my case.
Please advise thank you in advance.
There are a couple of options here.
Hangfire
Hangfire is an open-source library that can run background jobs in queues. In your case, you can enqueue each request from the client in a queue. Then Hangfire server will process them one by one (even with retry if the job fails). Hangfire supports SQL Server or Redis. You can query the storage to see the status of the queued jobs.
Hangfire can also run scheduled jobs, which will take care of that only one job run at a time.
Azure Service Bus
A more expensive option is to use Azure Service Bus for your queueing capability. For scheduled jobs, you can use AKS CronJobs but you will
implement the check yourself to see if there is a job already running.
Overall, I would recommend Hangfire, which can meet your requirements and is cheaper.

Background service in azure planned to run at scheduled time

I need to create a background job. There is NO trigger point for this.
It should run at FIXED time every day. It need to fetch data from some external API and update our application database. I need to setup it in Azure. What managed service I should use?
Azure Functions or Azure Webjobs. Both support schedule:
https://learn.microsoft.com/en-us/azure/app-service/webjobs-create#CreateScheduledCRON
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer
Azure Automation might be the answer also, depending on your language preference:
https://learn.microsoft.com/en-us/azure/automation/automation-schedules

Azure WebJob or Scheduler or another technology?

I am writing an Azure hosted MVC website for a gym booking system. I need to be able to maintain membership expiry, suspensions as well as gym class attendence (i.e. logging to the database if a session has been missed). Each of these tasks requires a "c# service function" to be run that will go through the database, perform some checks and update records as and when required.
I need this to run pretty regularly to ensure that missed sessions are logged asap. Should I be developing this as an Azure WebJob and running it continuously? Should i be doing it in another manner? If I could get some suggestions on routes to take that would be massively appreciated.
Thanks
You have a few options: Web Jobs, Scheduler, and Worker Roles.
Web Jobs are a nice addon to an existing azure web app and have the benefit of no additional cost. Web Jobs use Scheduler under the covers if you choose to schedule the Web Job to run at an interval other than continuously. Here is a nice answer that describes the differences between the two.
Worker Roles would be the next logical step up from a Web Job. Worker Roles are dedicated Cloud Service VMs that can provide more dedicated power and offer greater scaling capabilities. Worker Roles can also do much more than just run jobs.
For the application you have described, if you are already running on Azure App Services (Web App) it sounds like a continuously running Web Job would be the correct choice.

Microsoft Azure Worker Role or Azure Scheduler for Backup and Restore?

Creating Backup and restore Azure Table Storage Scheduler, where user will schedule the job or task to backup Azure Table at particular time, from Wizard. Which way I must Prefer?
Should I use Azure Service i.e Creating WebRole and Worker Role.
In this case how to Execute Worker Role on Schedule.
Can I use Web Job with Scheduler?
How to use Azure Scheduler to achive this task? I have googled out
where in some blogs they suggested to use Scheduler with Azure
Queue.
You can use either. Azure WebJobs are simpler and easier to use and would work well for your scenario.
You can use Azure WebJob with Azure Scheduler. You can set the schedule ahead of time where the scheduler will trigger the WebJob where you can perform your backup task.
Please see these articles
http://azure.microsoft.com/en-us/documentation/articles/websites-dotnet-deploy-webjobs/#configure
http://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/#CreateScheduled
I would use the Azure Scheduler. If your are familiar with a Cron job, this is very similar. All the Azure Scheduler does is make a REST call to an end point on a schedule. This would probably be more cost affective then setting up a worker role. Also, I would make sure to take into account security when setting up the Azure Scheduler. I would pass some type of secret to the API as a parameter so that it's not open to anonymous calls (although technically it would be.) If you want to execute certain tasks during the call, then I would store them in a table in your database. The worker role came before the Azure Scheduler, so the worker role lost in my book when the scheduler was made public.
UPDATE:
Another thought, is to look into the automation option in Azure: https://msdn.microsoft.com/library/azure/dn643629.aspx
With this option you can execute PowerShell scripts:
http://azure.microsoft.com/blog/2014/08/20/azure-automation-capabilities-in-depth-the-azure-automation-powershell-cmdlets/

How can I set up a CRON job using Windows Azure?

Is there a way to use the windows scheduled task to kick off a url or a exe on a schedule?
Can I write a program as an exe then create a Azure VM then RDP into the Azure VM and hook it up to windows task scheduler?
Azure does have a scheduler now.
It allows invoking a Web Service over HTTP/s and post a message to a Windows Azure Storage Queue. It's very new but it can be free if you do not need the scheduler to be executed often. Otherwise it's a small monthly fee which come with scheduled task that can be up to every minute.
Things got much easier lately, please see this link https://azure.microsoft.com/en-us/services/scheduler/ to create a scheduled job in the new Azure Scheduler. There is a basic Free tier as well as some paid options but I think this is exactly what many of us were looking for. It is an excellent solution for triggering URLs with GET,POST,PUT,DELETE requests.
Just follow the simple instructions. Starting by selecting "Scheduler" from the Azure dashboard app menu:
Today the scheduler has been Azure Logic Apps:
https://learn.microsoft.com/en-us/azure/logic-apps/logic-apps-overview
If you are looking for something like a cron job (which is a job, that is being run at specific time again and again), then check out Azure Functions:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview
Google Azure Storage Queues. They allow you to schedule jobs that will run at a later date. You can even specify when the job should run.

Resources