Deploying Azure WebJob for Process Flow Runs

This document directs the user to configure the Process Flow Runs on Azure Portal and Aptify Smart Client. This web job replaces the Process Flow Runs Async Server functionality. The Web Job runs on Continuous Mode and picks and executes Process Flow Runs record which are fitting in a particular criteria.

This document provides the information on how to setup new web jobs and configure existing process flow runs as Azure WebJobs. This topic is divided into two parts:

Following is the scope of the Process Flow Runs as Azure WebJobs:

  1. Only those Process Flow Runs records with status as “Pending“ and ScheduledTaskId is -1 are executed.

  2. The Scale of the job will always be “Single Instance“ and Type “Continuous“ on Azure Portal, more is discussed in this document.

Below screen shots are for reference purpose only. Please provide the details specific to your environment. 

Part 1: Code File Config Changes:

  1. Extract the APTIFY_700_Database zipped file and go to the Core Database Setup->Utility-> ProcessFlowRunWebJob folder.

  2. Search for ProcessFlowRunWebJob.exe.config and open the same in Notepad or Notepad ++

  3. Configure the tags “AzureWebJobDashboard“ and “AzureWebJobStorage“ with Storage Account Connection String.

  4. 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.

  5. The below keys are required by web job to log into the database:

    1. UserDatabase = “Aptify

    2. EntitiesDatabase = “Aptify“

    3. SqlLogin and Password will be the credentials to log into the db.

    4. Server = Managed instance Endpoint (See Point 5.d.i to 5.d.iii)

      1. To get managed instance endpoint, log in to the Azure portal and select SQL Managed Instances Service.

      2. Select the instance to be connected with the web jobs

      3. Once you select the instance you will find Networking under Security and Endpoint on the right pane of screen as highlighted in the below screenshot.

  6. Once all 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.

Part 2: Deploying the zipped code file on Azure Portal

  1. Open Microsoft Azure Portal, on the home page, click App Services.

  2. Select the App Service through which your web job will run.

  3. After selecting App Service on the newly opened right pane select “WebJobs“ under “Settings

  4. Under WebJobs, click + sign to add a new web job. A new pane Add WebJob opens on the right side of the screen. Under Name, give any meaningful name for the job.

  5. Under File Upload, click upload button and a new window opens. Now select the zipped file created in Part 1.

  6. Set the Scale to Single Instance.

  7. Click OK, it may take few seconds for the job to be visible on the dashboard in Running Status. Now the ProcessFlowRun records will start executing as per their schedule.