How can I dynamically discover services hosted in service fabric from API management?

Here’s a way to discover services and endpoints running in the cluster. (Keep in mind that you’ll need to monitor changes too.) private static void ListEndpoints() { var resolver = ServicePartitionResolver.GetDefault(); var fabricClient = new FabricClient(); var apps = fabricClient.QueryManager.GetApplicationListAsync().Result; foreach (var app in apps) { Console.WriteLine($”Discovered application:'{app.ApplicationName}”); var services = fabricClient.QueryManager.GetServiceListAsync(app.ApplicationName).Result; foreach (var service … Read more