1

How do you configure different application instances? I know you can parameterize the ApplicationManifest and service Config packages, but how would you specify a different port for the webservice in two different application instances? The endpoint for the webservice is defined in the ServiceManifest, which can not be parameterized afaik.

<Resources>
  <Endpoints>
    <!-- This endpoint is used by the communication listener to obtain the port on which to 
           listen. Please note that if your service is partitioned, this port is shared with 
           replicas of different partitions that are placed in your code. -->
    <Endpoint Protocol="http" Name="ServiceEndpoint" Type="Input" Port="80" />
  </Endpoints>
</Resources>

Say I have an Application Type MyAppType which contains a service type MyWebSvcType. I create two instances of the application type MyAppTenant1 and MyAppTenant2. How do I specify that the webservice of MyAppTenant1 listens on port 80 and the webservice of MyAppTenant2 listens on port 81. This is because they could be on the same node, and thus should listen to different ports.

Cpt Slow
  • 370
  • 3
  • 18

1 Answers1

1

If you omit the Port attribute, your service instance will get a dynamic port assigned. You can find the service endpoints by using code or you can access it through the built in reverse proxy.

More info here and here.

Community
  • 1
  • 1
LoekD
  • 11,402
  • 17
  • 27
  • I tried your suggestion for using the Reverse Proxy. However, it seems to always send my requests to the first application instance, no matter the application name I put in the URL, like 'http://mycluster:19008/PartitionTestGreen/WebSvc/api/Values/10' still sends me to the PartitionTestYellow application instance instead of the PartitionTestGreen instance. – Cpt Slow May 04 '17 at 12:44
  • I don't have to configure anything on the reverse proxy itself? It is enabled (shows in the portal as enabled) and it clearly forwards requests for all application instances, but only to the wrong instance (always the same). – Cpt Slow May 04 '17 at 12:50
  • I haven't experienced that problem myself, it works fine for me. No additional configuration is required. Can you run the code snippet that lists endpoints, to see if all endpoints are as you'd expect them to be? – LoekD May 05 '17 at 06:35