Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在每个工作角色实例上运行一个 cmd 脚本。所以我为每个工作角色创建了一个 WCF 服务。但我只得到VIP。如何使用内部 IP 并打开每个端点并在每个实例上运行 cmd 脚本?有人对此有什么建议吗?还是使用其他方式?
如果您想在启动时运行 cmd 脚本...您可以为此目的在 csdef 中使用启动任务...这将确保 cmd 脚本在每个实例上运行。某些启动任务可能需要提升的权限才能运行...还相应地配置启动任务类型...因为如果本质上是顺序的,它可能会增加您的部署时间。
如果由于某种原因这不适用于您的需求,您可以探索 InstanceInputEndpoint 它可以为您提供特定 VM 实例的句柄。