1
votes

I want to run a scheduled script using WebJob. Due to source control enabled, I could not create WebJob using portal & had to copy files using Kudu (Diagnostic) Console. These are the files under triggered jobs in the folder:

enter image description here

The run.js file simply calls an API. The settings.job contains the schedule I want it to run at: { "schedule": "0 /1 * * * *" } But the job does not start on its own or shows up in list of WebJobs: enter image description here

Is there something else that needs to be done to publish or trigger a WebJob or something more that I need to add to settings.job file? I have been referring to this

1
What is the path to the files in the screenshot?Repcak
If you need further help, pls let me know.Jason Pan

1 Answers

0
votes

Follow my steps, you can solve the problems you can't add webjob on portal.

Due to source control enabled, I could not create WebJob using portal & had to copy files using Kudu (Diagnostic) Console.

Step 1. Add a webjob arbitrarily on the portal.(upload .zip file or create by kudu)

enter image description here

enter image description here

enter image description here

Step 2. Deploy by VS2019(source control)

enter image description here

Step 3. After success, you will find you can add webjob by upload .zip file.

enter image description here

Now, I will upload nodejs webjob.

Please note that you need to create a continuous or Triggered webjob. The two are different. In the portal, the schedule of the continuous webjob is displayed as n/a, while the Triggered display format is such as: 0 */15 * * * *.

  1. run program in my local pc and it works fine.

enter image description here

  1. Compress it and upload in portal.

enter image description here

  1. check running logs and it works fine, and result is same as local.

enter image description here

Finally ,let us check the content in .zip file.

enter image description here