多Azure的webjobs可以共享相同的组件? [英] Can multiple Azure webjobs share the same assemblies?

查看:150
本文介绍了多Azure的webjobs可以共享相同的组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要天青WebJob使用4种不同的命令行参数来运行4种不同​​的方式和在不同的时间。我可以设置的参数有run.cmd但似乎浪费空间有4套组件。多个webjobs可以定义运行同一组的组件,从同一文件夹。每个webjobs只会有一个run.cmd调用该文件夹的EXE。

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.

推荐答案

这是不可能的开箱即用的。

This is not possible out of the box.

有一种方法可以做到这一点,虽然,但有代价的,你可以在你的网站,例如与您的二进制文件一个目录(在某个地方: D:\\家\\网站\\ wwwroot的\\ app_data文件\\ \\工作共同),并有你WebJobs不仅是一个 run.cmd 脚本中的每个使用适当的参数调用该公共目录:

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

问题是更新的故事,当你需要更新这些常见WebJobs二进制文件,你首先必须停止WebJobs因为这些文件可能会被锁定,然后再启动它们。

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.

这篇关于多Azure的webjobs可以共享相同的组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆