[Guest Executable] Can we expose 2 endpoints from a guest executables one from Kestrel and othe from service manifest?

Babish Adapa 1 Reputation point
2021-04-28T00:58:51.517+00:00

Our application is asp.net core app, we have migrated it to a guest executable and exposed an endpoint like below.

.ConfigureKestrel(serverOptions =>
{
var port = Convert.ToInt32(configurationRoot["ApiConfig:ApiSslPortNumber"]);

                serverOptions.Limits.MaxRequestBodySize = 51200 * 1024;
                serverOptions.Limits.MaxConcurrentConnections = null;
                serverOptions.Limits.MaxConcurrentUpgradedConnections = null;
                serverOptions.Limits.MinRequestBodyDataRate = null;
                serverOptions.Listen(IPAddress.IPv6Any, port, (listenOptions) =>
                {
                    var httpsOptions = new HttpsConnectionAdapterOptions
                    {
                        ClientCertificateMode = ClientCertificateMode.AllowCertificate,
                        CheckCertificateRevocation = true,
                        ServerCertificate = sslCert
                    };
                    //https ssl cert configuration
                    listenOptions.UseHttps(httpsOptions);
                    listenOptions.NoDelay = true;
                });
            })

In service manifest file, we have added below line as we have a requirement to populate ReplicaAddress - as we are monitoring ReplicaAddress from other service.

<Endpoint UriScheme="https" Name="ServiceEndpoint" Type="Input" Port="443" />

Question is can exposing two endpoints with same port from service fabric would cause any problem?
If it does not cause any problem, we can proceed with change.
if it does, we need to find a way to merge these endpoints into a single one.

Would appreciate if you have any such github examples

Azure Service Fabric
Azure Service Fabric
An Azure service that is used to develop microservices and orchestrate containers on Windows and Linux.
253 questions
{count} votes

1 answer

Sort by: Most helpful
  1. prmanhas-MSFT 17,891 Reputation points Microsoft Employee
    2021-05-06T06:57:12.72+00:00

    @Babish Adapa Thank you for your patience over the matter.

    I had discussion internally and they confirmed that Service Fabric doesn't support multiple protocol for same port number.

    You can refer to this as well for more information.

    Hope it helps!!!

    Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

    0 comments No comments