Azure Fabric 服务中的服务实例计数

Service instance count in Azure Fabric Service

有没有办法通过代码在任何给定时间找出结构服务集群中 运行 的服务类型的实例数?一种方法是查看 ApplicationManifest 文件并获取其中设置的实例数,但有时它可能会被参数文件覆盖。这里有什么想法吗?

如果您想以编程方式检查您的服务,请查看 FabricClient which exposes a number of operations that could show you the status deployed services. For your specific question, get the number of running instances, have look at FabricClient.QueryClient.GetReplicaList...(...),它会给您一个副本列表(对于无状态服务,这与实例相同)。