I sometimes run projects locally out of visual studio is there a better way to detect if I'm hosted by SF rather than the exception. I can see possibly the path or entry assembly but there must be a better way.
try
{
ServiceRuntime.RegisterServiceAsync("FisConfigUIType",
context = > new WebHost < Startup > (context, loggerFactory, "ServiceEndpoint", Startup.serviceName)).GetAwaiter().GetResult();
Thread.Sleep(Timeout.Infinite);
}
catch (FabricException sfEx)
{
RunLocal(args, loggerFactory);
}
Today, we are announcing the retirement of Azure Service Fabric Mesh. We will continue to support existing deployments until April 28th, 2021, however new deployments will no longer be permitted through the Service Fabric Mesh API.
Access the logs of a running container In a web browser, open Service Fabric Explorer from the cluster's management endpoint by navigating to http://mycluster.region.cloudapp.azure.com:19080/Explorer . Container logs are located on the cluster node that the container service instance is running on.
Check Service Fabric Environment Variables:
var sfAppName = Environment.GetEnvironmentVariable("Fabric_ApplicationName");
var isSf = sfAppName != null;
Source: from @mkosieradzki GitHub Issue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With