I have an Azure web app that includes some web jobs to run some background tasks. These tasks need to run on a schedule (every 6 hours). Using a WebJob it was pretty easy to achieve the goal. However, recently we decided to use Web Roles instead of the Web App. For running the background tasks I have been looking at using Worker Roles in-place of WebJobs. However I am facing issues in scheduling the tasks.
How do I schedule the tasks in the worker role? Moreover, since I am using multiple instances of the Cloud Service, do I need to take some extra precautions to ensure that only a single instance of the worker role run the tasks at one point of time?
Mimicking Schedule function in Webjob in Worker Role
311 Views Asked by Pratik Bhattacharya At
1
There are 1 best solutions below
Related Questions in AZURE
- Why does Azure Auto-Scale scale go lower then minimum amount of instances?
- Data execution plan ended with error on DB restore
- Why does Azure CloudConfigurationManager.GetSetting return null
- Do I need other roles than Worker Role for a web site and service layer in Azure?
- Azure Web App PATH Variable Modification
- Azure Data Factory: LinkedService for AzureSql in failed state
- How To Update a Web Application In Azure and Keep The App Up the whole time
- Using Azure MobileServices library with my own LAN WebApi
- ionCube loader error on Azure IIS
- App crash (if closed) after click on notification
- How to get sql data bases instances in azure using java api
- I want to create file in azure share using python PUT requests but getting error signature not correct including headers
- Enabling OPTIONS method on Azure Cloud Service (to enable CORS)
- Redirecting subdomain to directory on Azure
- Kaltura account settings error
Related Questions in AZURE-WEB-ROLES
- Do I need other roles than Worker Role for a web site and service layer in Azure?
- Web Application Proxy + Azure WebRole
- What is Web Role and Worker Role in Azure?
- How to get full list of CloudConfiguration from inside a web service at runtime?
- Application Insights - How to add custom metric to your request information?
- Azure - How to programmatically distinguish between different events (deployment vs restart vs VM move)
- Azure cloud service network bandwith
- Lot of System.Invalidoperation - SOS has no stack trace
- Azure traffic manager -IP whitelisting
- Converted MVC app to Azure Cloud Service Project - cant get latest
- How to configure Anti Malware for cloud Services
- Azure Web Role with Transient Fault Handling Block exception: The path is too long after being fully qualified
- TLS fatal alert code 48 on Azure web role
- Azure backend data processing architecture
- Refresh Validation Settings stopped working
Related Questions in AZURE-WORKER-ROLES
- Do I need other roles than Worker Role for a web site and service layer in Azure?
- Signal that an Azure worker role should not be scaled down while processing
- How to overcome : Failed to generate Azure Service package?
- Receiving Azure service bus messages from multiple, dynamically queues with worker role
- What is Web Role and Worker Role in Azure?
- Azure Service Charge For A Worker Role
- Azure WorkerRole trigger on queue like WebJob
- Secure connection string in Worker Role
- How can Azure instance determine its instance level public ip address (ILPIP)?
- Azure Cloud Service - EventProcessor IEventProcessor.ProcessEventsAsync not getting hit
- Azure cloud service network bandwith
- How to publish the WSDL at the public domain name in a WCF service hosted in an Azure worker role?
- Copy file from remote server using SFTP straight to Azure blob storage
- Accessing executing assembly from worker role
- SignalR on multiple Windows Azure instances (no backplane)
Related Questions in AZURE-WEBJOBS
- Access Registry From WebJob/WebApp
- Azure WebJob ServiceBusTrigger for Sessions
- Azure WebJob or Scheduler or another technology?
- Deploying a scheduled webjob to Azure Webapp without Visual Studio
- Connecting to Yammer from Azure Webjob
- Failing azure webjob (error code -2146232576)
- View local Azure Webjobs SDK dashboard for debugging WebJobs SDK console process
- Azure WebJob QueueTrigger How DeleteMessage after get it?
- How continuous Azure Web Jobs can be idempotent and send email?
- Azure API App support for WebJobs
- Deploying a WebJob with a static Content file
- How can I add a .props file to a C# project?
- Stuck when publishing Web App to Azure with WebJob
- Website not updated when deployed with a WebJob
- Azure WebJob deployed from Bitbucket is set up as continuous instead of scheduled
Related Questions in AZURE-SCHEDULER
- How to check number of jobs remaining in job collection of Azure scheculer
- Deployment Slot for Azure Scheduler and Azure logic Apps
- Windows Azure Scheduler Job Completed Unexpectedly
- Trigger Azure Data Factory Pipeline on second Friday from end of month and on Tues, Wed and Thurs of the same week
- Azure Scheduler Long Running HTTP Action
- Call asmx web service from Windows Azure Scheduler
- Azure Update Scheduled Job API - Malformed Job Object
- How to create recurring weekly job in Azure Scheduler programmatically
- In Azure Scheduler, how to programmatically create recurring monthly job?
- Running PowerShell Script in Azure as a task scheduler without creating any virtual machine
- Running an exe file on premises from azure scheduler?
- User Scheduled Jobs in Azure
- How to genrate excel file on azure storage using c# console application?
- How do I use a bearer authorization token in a Azure Scheduler job?
- Create webjobs programmatically in Azure
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can use the Azure WebJobs SDK in a Worker Role to schedule tasks. The SDK includes a TimerTrigger extension (details here) that can be used run functions on schedule. For example you can simply write a function:
Your startup code would look like: