Web Jobs is a feature of Azure App Services that runs a program or script in the same instance as a web app, API app, or mobile app. There is no additional cost to use Web Jobs. Azure Aptify Azure Enablement comes with the ability to run the existing schedule tasks (configured in Aptify Smart Client) on Azure Portal as a Web JobWebJobs.
This document provides the information on how to setup new web jobs and configure existing web jobs to run as Azure WebJobs. This topic is divided in into three parts:
Table of Contents | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Only Once, Daily, Weekly, Monthly, Monthly Relative types of frequencies are supported.
Run History Tab on Scheduled Task records will not be updated.
Service should always be “Schedule Web Job Only“"on Scheduled Task record to run the task as WebJobWebJobs.
The functionality of the checkbox “Delete the task if it is not scheduled to run again“ ” is not in scope for now.
The Scale of the job will always be “Single Instance“ ” and Type “Continuous“ ” on Azure Portal, more is discussed in the document below:
...
Open the Zipped Folder Containing the code files. <<path and name of the file>>
Search for WebJobManualDeploy.exe.config and open the same in Notepad or Notepad ++.
Configure the tags “AzureWebJobDashboard“ and “AzureWebJobStorage“ with Storage Account Connection String.
Under the appSettings tag, the value for key=” frequency” will be any one of the following: all, once, daily, weekly, monthly, monthlyRelative. This is for the type of job which is needed to be scheduled on portal. For example, a code with frequency daily will only run the task which are of type daily in database. It is to be noted that this setting is case sensitive.
App Insights has been configured for these web jobs and logs can be found in App Insight log file. To enable the app insights, Instrumentation Key is required (Line 25 of the picture below). Refer to Configuring Serilog with Azure Application Insights to know more about App Insight log files.
To get the instrumentation key for App Insights, log in to Azure portal and select the service Application Insights.
Select the Application Insights for which you want to configure the logs.
Under the overview tab you will find the Instrumentation key.
The below keys are required by web job to log into the database:
UserDatabase = “Aptify”
EntitiesDatabase = “Aptify“
SQLLogin and Password are the credentials to log into the database.
Server = Managed instance Endpoint (See Point 10-12)
Points 6.d.i to 6.d.iii)
To get managed instance endpoint, log in to the Azure portal and select SQL Managed Instances Service.
Select the instance to be connected with the
WebJobs.
Once you select the instance you will find Networking under Security and Endpoint on the right pane of the screen as highlighted in below screenshot.
Once all the changes are done in config file, save and close it. Select all the code files and zip them, give the zipped file a meaningful name.
...