Service Fabric - Https and Http

There are several good resources to set up Service Fabric Https endpoints. I would reference here HTTP & HTTPS in Service Fabric Web API which describes all the necessary steps to set up Http and Https endpoints. Doing the work manually will result pretty similar, except for the last step, which can trick the usual developer:

new ServiceInstanceListener(serviceContext =>
new OwinCommunicationListener(Startup.ConfigureApp, serviceContext, ServiceEventSource.Current, endpoint));

When you add one ServiceInstanceListener (Http or Https) the endpoint will open, but adding multiple, the code above will fail to open any endpoints.

The key step here is an optional parameter in the constructor of ServiceInstanceListener. Unless the name specified we will not be able to open multiple endpoints. So one suggestion to correct the above code:

new ServiceInstanceListener(serviceContext =>

new OwinCommunicationListener(Startup.ConfigureApp, serviceContext, ServiceEventSource.Current, endpoint), endpoint);