To ask briefly, is there a way to specify Service/Application Startup dependency in Azure Service Fabric?
I have two services, say S1 and S2. S2 depends on S1, and must be started after S1 starts. Currently S1 and S2 are under different applications packages. I can also put them into one application package if necessary.
It works if I start S1 first, then S2 during deployment. However, seems that Service Fabric has some maintenance work, during which services get restarted. Now the problem is that the order of starting S1 and S2 is not guaranteed, which causes S2 to fail to read some configurations during initialization. S2 fails silently but keeps running.
In Service Fabric there's way to specify SetupEntryPoint", however in this case S1 itself has an "SetupEntryPoint", besides I feel it is not proper to put a long running service under "SetupEntryPoint".
I'm also thinking about making S2 stop when it fails to read configurations from S1, in that case Service Fabric will keep trying restarting S2 until S1 gets started.
But is there any way to guarantee S2 starts after S1 through Service Fabric config?