Search code examples
rpcazure-service-fabric

Accessing Service Fabric RPC interface from remote location


Is there a way to call RPC endpoint exposed by service fabric service from remote location?

This code creates client that is able to access RPC exposed by service fabric that is on the same machine:

var client = ServiceProxy.Create<ISomeRpcInterface>(
    new Uri("fabric:/AppName/ServiceName"), 
    null, 
    TargetReplicaSelector.Default, 
    "ListenerName");

Do you know if it is possible to construct this URI in a way that would enable me to access RPC endpoint from remote location (can i provide domain/ip here somehow)? I tried most obvious ways to do that and it didn't work.

I need this functionality to write a test that would check if RPC interface is set up correctly.


Solution

  • As far as I know, there is no way for the ServiceProxy instance to resolve URLs outside the cluster. That being said you MIGHT be able to expose the naming service and communicate with it directly, though I doubt the result is going to be pretty.

    In general it seems like most solutions revolve around exposing the services as HTTP and then using the reverse proxy on external clients.