I am creating a dot net console app that will run as an Azure webjob. It is scheduled to run once an hour.
I am wondering how I pass a parameter to the job when it is invoked?
Summary. Azure Functions offers more developer productivity than Azure App Service WebJobs does. It also offers more options for programming languages, development environments, Azure service integration, and pricing. For most scenarios, it's the best choice.
Scheduled – We can execute a Scheduled WebJob by writing a CRON Expression. CRON Expressions define the schedule on which we need the WebJob to run. Manual – We can of course trigger a WebJob manually by calling the webhook. Several Azure services can communicate with the WebJobs using the webhook triggers.
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. job to make the file. Then click the pencil icon to edit it right in Kudu.
Scheduled WebJobs are actually 2 separate resources:
To pass parameters to the WebJob you need to go to the scheduled job (in the management portal) and update the url that is used to invoke the triggered WebJob.
The REST API is described here: https://github.com/projectkudu/kudu/wiki/WebJobs-API#invoke-a-triggered-job
Basically you just need to add ?arguments={your arguments}
to the end of the url.
These arguments are passed as command line arguments to your executable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With