locked
Service Fabric Connectivity with database and Stateless to Stateful RRS feed

  • Question

  • I am developing micro services in Service fabric and facing following issues:

    1. How to connect Service Fabric microservice to sql server database

    2. How to call Stateful service from stateless service 

    3. How to call Stateless service from outside of service fabric e.g. from .NET application like web/windows application.

    Please advise.

    Sunday, November 27, 2016 8:56 PM

Answers

  • Forget about microservice and service fabric for the moment. Have you been able to make all these work in a normal App Service environment?

    Frank

    Monday, November 28, 2016 3:57 PM
  • Forget about microservice and service fabric for the moment. Have you been able to make all these work in a normal App Service environment?

    Frank

    Yes - do this first :)

    Then

    1) Nothing special about SF

    2) ServiceProxy

    3) ServiceProxy if there is direct connectivity to the cluster (ie: the Service is listening on IP addresses that the client can connect to and there's no LB or firewalls in the way). Otherwise you probably want to have the client speak something like http and then have a gateway in the cluster resolve the actual service and forward it. Almost all of our samples show how to do this. There's also a reverse proxy built into Service Fabric that you may be able to use.

    Monday, November 28, 2016 9:48 PM

All replies

  • Forget about microservice and service fabric for the moment. Have you been able to make all these work in a normal App Service environment?

    Frank

    Monday, November 28, 2016 3:57 PM
  • Forget about microservice and service fabric for the moment. Have you been able to make all these work in a normal App Service environment?

    Frank

    Yes - do this first :)

    Then

    1) Nothing special about SF

    2) ServiceProxy

    3) ServiceProxy if there is direct connectivity to the cluster (ie: the Service is listening on IP addresses that the client can connect to and there's no LB or firewalls in the way). Otherwise you probably want to have the client speak something like http and then have a gateway in the cluster resolve the actual service and forward it. Almost all of our samples show how to do this. There's also a reverse proxy built into Service Fabric that you may be able to use.

    Monday, November 28, 2016 9:48 PM
  • I am not sure any of the responders understood your problem.
    Thursday, June 20, 2019 12:48 PM
  • You haven't told us whether the SF You use is in Azure or on premises.

    Ad 1) You can either let Your SF App run under a specific AD account and let the app use SSPI (intgegrated windows authentication) while connecting to SQL Server or You can encrypt the SQL Credentials in the app settings.

    Ad 2) There are many possibilities, but for internal communication (inside SFC) the  recommended communication stack is Service Remoting

    Ad 3) You can use whatever You want - REST API, WCF, gRPC. Usually You let the service that needs to be accessible from outside of the cluster be present on every node of a cluster (instance count equal -1) and have some load balancer or custom service discovery in front of Your cluster. You can also use Rev proxy if You want (built in LB and discovery)  but that only for HTTP(s) protocol.


    Friday, June 21, 2019 7:05 AM