with azure webjobs how do i pass parameter for a scheduled task

≯℡__Kan透↙ 提交于 2019-12-04 18:03:53

问题


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?


回答1:


Scheduled WebJobs are actually 2 separate resources:

  1. Triggered WebJob
  2. Azure Scheduler Job

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.



来源:https://stackoverflow.com/questions/29526669/with-azure-webjobs-how-do-i-pass-parameter-for-a-scheduled-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!