本文介绍了将命令行参数添加到Azure WebJob部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用VS2015将webjob部署到Azure,但是找不到在webjob-publish-settings.json中添加命令行的方法.有什么办法吗?
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?
推荐答案
您可以通过以下方式进行操作:
You can do this in the following way:
- 在VS中将
run.cmd
文件添加到WebJob(与Program.cs
相同的位置) - 确保将此文件的复制到输出目录"设置为
Copy if newer
(在文件属性中) - 在该文件中,只需添加一行包含以下内容的行:
NameOfYourExe.exe /dosomething
- Add a
run.cmd
file to your WebJob in VS (same place as yourProgram.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
当部署到Azure(在D:\home\site\wwwroot\app_data\jobs\continuous\MyContinuousWebJob
下)时,此文件将优先于.exe
,并且最终将使用您的参数运行.exe
.
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.
这篇关于将命令行参数添加到Azure WebJob部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!