Add command line arguments to Azure WebJob deployment

丶灬走出姿态 提交于 2019-12-08 13:01:38

问题


I'm deploying webjob to Azure using VS2015, but cannot find way to add command line in webjob-publish-settings.json. Is there any way to do it?


回答1:


You can do this in the following way:

  • Add a run.cmd file to your WebJob in VS (same place as your Program.cs)
  • Make sure to set this file's Copy to Output Directory to Copy if newer (in the file properties)
  • In that file, just add one line that has: NameOfYourExe.exe /dosomething

When deployed to Azure (under D:\home\site\wwwroot\app_data\jobs\continuous\MyContinuousWebJob), this file will take precedence of the .exe, and will end up running the .exe with your params.




回答2:


Arguments are not part of the definition of the json:

webjob-publish-settings.json definition

So adding them is not possible in the current version.



来源:https://stackoverflow.com/questions/35362847/add-command-line-arguments-to-azure-webjob-deployment

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