Where do you set and access run-time configuration parameters per environment for service fabric?

In order to have per environment variables for running Service Fabric locally and in the cloud this is what you must do: Add your custom config section and parameters to the Settings.xml file of the Service/Actor project (located at \PackageRoot\Config\Settings.xml from the project root). Leave the parameters blank as we will be setting these elsewhere … Read more

How to add message header to the request when using default client of Azure service fabric?

Update With SDK v2 you can now (relatively) easily modify the headers of both Reliable Services and Actors. Note in the examples below some wrapper members were omitted for brevity. Client We use ServiceProxyFactory to create proxies instead of the static ServiceProxy. Then we can wrap IServiceRemotingClientFactory and IServiceRemotingClient and intercept the service calls. The … Read more

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