问题
I have an Azure WebJob that needs to be run 4 different ways and at different times, using 4 different command line parameters. I can set the parameters with a run.cmd but it seems like a waste of space to have 4 sets of assemblies. Can multiple webjobs be defined that run the same set of assemblies, from the same folder. Each webjobs would just have a single run.cmd that called the exe from that folder.
回答1:
This is not possible out of the box.
There is a way to do it though but at a cost, you can have one directory with your binaries (at some place on your site for example: d:\home\site\wwwroot\app_data\jobs\common) and have your WebJobs only as one run.cmd script each with the proper arguments calling to that common directory:
@echo off
d:\home\site\wwwroot\app_data\jobs\common\DoWork.exe job1
The problem is the update story, when you need to update these common WebJobs binaries you'll first have to stop your WebJobs since the files will probably be locked and start them afterwards.
来源:https://stackoverflow.com/questions/25735831/can-multiple-azure-webjobs-share-the-same-assemblies