'how to get the settings.job file added in Azure Web Job created out of .net 5 console APP

I have created a seetings.job file like below pasted one, not sure how it is from the solution.

This is for Azure Web job created out of Azure web job SDK.

This file didn't get created when I add Azure web SDK, but I cannot recollect how it is created.

Could find it in add options?

{
  //    Examples:

  //    Runs every minute
  //    "schedule": "0 * * * * *"

      //Runs every 15 minutes
      "schedule": "0 */05 * * * *"

  //    Runs every hour (i.e. whenever the count of minutes is 0)
  //    "schedule": "0 0 * * * *"

  //    Runs every hour from 9 AM to 5 PM
  //    "schedule": "0 0 9-17 * * *"

  //    Runs at 9:30 AM every day
  //    "schedule": "0 30 9 * * *"

  //    Runs at 9:30 AM every week day
  //    "schedule": "0 30 9 * * 1-5"
}


Solution 1:[1]

There are 2 ways to get the setting.job file added in Azure web job created for .Net Console Application:

  1. Publish your console application to Azure as a Azure WebJob by right clicking on your project in the solution explorer.

enter image description here

When you do publish as Azure WebJob, then the settings.job file will be added immediately after publishing and you can edit for your required functionality.

  1. You can manually add WebJob from the Azure Portal to your Console Application App service.

Steps:

  1. Azure Portal > Resource Group > Your App Service > Web Jobs (in the left index pane) > Click on Add

enter image description here

After that, the settings.job file will be added to your application.

Output:

enter image description here

Above is the successful scenario.

Failing Scenario: When I tried to add web jobs file manually from the portal, I zipped entire console application and uploaded in the web jobs I got the below error:

enter image description here

Solution 2:[2]

You can do this via kudu. Go to https://yourappservicename.scm.azurewebsites.net, then click Debug -> CMD or Powershell (go with Powershell), then navigate to site\wwroot\App_Data\jobs\{continuous/triggered}\job-name\.
Type touch settings.jobto make the file. Then click the pencil icon to edit it right in Kudu.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 HariKrishnaRajoli-MT
Solution 2 Dom Barnes