How to schedule a job on Azure? - c#

So here is my requirement,
I have a service provider that generates a files with data in a proprietary format on a text file. I have to download the file, parse it, then process it for specific records, and then update the database accordingly. The process needs to run multiple times on specific days (mostly Mondays & Fridays).
I am using Windows Azure platform. My website is hosted on azure & using SQL Server as my database. Using C# to create the database updater app.
What is the best approach to schedule a database updater job? Do I even need the updater application to be written on there is some better way to achieve the above.
Thanks

Based on the information you've provided I'd start by exploring Web Jobs (http://www.hanselman.com/blog/IntroducingWindowsAzureWebJobs.aspx).
Web Jobs allow you to create a schedule jobs that will run for you at intervals or continually.

Related

Service to pull data from Azure Storage to local machine every day

I have a Azure process that stores some .png files in Azure File storage or Blob storage every 2 hrs. I want to create a service which will run from my machine and pull the latest files every 2 hrs . Please suggest if we can do this by Windows service or if there is any other better solution to Automate this.
Please suggest if we can do this by Windows service or if there is any
other better solution to Automate this.
Yes, you could do it with windows service ,this is the official doc, it also shows how to add Timer Event then you could handle Azure-Storage like normal program.
Or you could choose to use console app, this also could satisfy your requirement. You could use a Timer to handle Azure-Storage , however you need to keep this app running all the time.
If you still have questions, please let me know.

Cloud load data from web Azure

I am new in Azure and cloud computing and I want to do a little project in Azure. My idea is to get some data from a webpage and then store it in an Azure SQL database.
I want it to be an automatic script that will run every hour and save the results to the database. What service should I choose in the Azure platform? Worker service?
I have done something similar recently with more complexity(using queues and service bus)
For this Automatic background tasks Worker Role is the ideal choice
use Quartz.NEt for scheduling your job
This link is perfect for your needs just follow the tutorial and you will get it running in no time
Worker role with Quartz.NET

Time-based notifications on Windows Azure

I have been building a Windows Phone 8 app and Windows Azure cloud service that will allow people to store schedules in the cloud. I have implemented a single sign on system and a cloud service used to store the schedule items.
I have also started building a cloud service to send push notifications however the plan is to send notifications based on scheduled times that have been stored in the cloud, the notification system works however only if I send a notification with a tester application.
Does anyone know how to send notifications based on a time record in an SQL database on Azure?
Thanks
As far as i understand you want a user to make a todoitem with a timestamp.?
If this is true, you could do it in some different ways. The easiest and most expensive is to only use azure. Then you need to use azure scheduler, to compare a time stamp with the current time and when the current time exceeds the time stamp, you send a push notification.
A cheaper way is to have an old pc, where you install server capabilities and go to the server and check the database with the time stamp. And then invoke a server api when you have a match.
But be aware of timezones :)
A link about timestamp in Azure tables
How to use Windows Azure Table Storage Timestamp or Etag field
Are you referring to the Azure Scheduler in Mobile Services?
Check out this link.
Otherwise I believe you'd need to have a service running that will run a task on scheduled times and occasionally poll the database for new times to run (pretty simple to do. Sounds like you probably have most of that already).

Cron-type scheduling for an ASP.NET web app

I was wondering if a web application for ASP.NET supports a scheduling feature similar to Cron jobs on a Unix-like platform?
PS. I'm coding in VS2010 using C#, and I need this feature to run C# script on a configurable schedule, based on date & time.
This sounds like a windows service project type.
You coluld use a web project as an editor, to configure various parameters, and persist them to a db or file, and then read them from the windows service.
Using a web app to execute some task at different intervals is not the best ideea.
While this could be done in theory, maybe you can split it in 2projecs: 1 web app that saves config params and maybe diplays the task status, and 1 windows service that reads the params, executes the tasks and maybe updates its status.
Why not just use the Windows Task scheduler to schedule the C# script? Do you not have admin privileges?
I use cron to kickoff my scheduled jobs on unix servers, and the Windows Task Scheduler to run them on Windows servers.
We have a commercial product that may be exactly what you're looking for. JAMS is an enterprise grade task scheduler and it includes ASP.NET controls that you can drop onto your web pages. We have controls to schedule, monitor and manage tasks as well as querying past history.
And, our .NET class library can be called from C# (or any other .NET language)
If you're interested, more information is available at:
http://www.JAMSScheduler.com

The best way of triggering a timely event

I am building an ASP.Net website, I have a db table which I want to reset a column in it for all rows. column type: byte
I want to do this every day at midnight, in an automatically way. I know I can set a job in SQL Server Management Studio but I want to do this in a programmatic way and my website will be the trigger for it.
I'm using C#.Net 2008 and MS SQL Server 2005
i.e. (Pseudo code)
if(new_day)// can we be accurate that time here will be around 12:00:05 at maximum?
// call sql stored procedure to reset that column
You could make a simple Windows service in C# that would run in the background but considering all you want to do is make database updates, it's best to keep it in the DB....I'd suggest going with the scheduled job in SQL
Your website only executes when a page is requested making it unable to act as a service that executes a task at regular intervals. The best solution is to use SQL Server directly to schedule the task, create your own service or execute an application at regular intervals using Windows task scheduler.
However, if you for are in hosted environment you may not be able to do any of this. In that case you can use the cache to simulate a service. Omar Al Zabir has an article on CodeProject that explains how you can do that: Simulate a Windows Service using ASP.NET to run scheduled jobs.
If you really want to: create a Scheduled Task that calls your website every day at midnight. The website itself cannot trigger itself, but a task can do this.
But really: just set up a SQL job.
SQL Agent job, scheduled to run at the specified time.

Categories

Resources