So I have an Azure Cloud Service, and right now it has 2 instances. I want the ability to communicate with each instance individually, and it seems to me that the info found here - https://msdn.microsoft.com/en-us/library/azure/hh180158.aspx - should give me just what I need.
What I don't understand is, how do I communicate with each instance? If I define 2 input endpoints for my web role, how does it "know" which instance responds to one port, and which to the other?
For example, here's a sample of the ServiceDefinition file Im currently playing with:
<ServiceDefinition name="BasicWrapperServices.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-06.2.4">
<WebRole name="MyCloudService" vmsize="Medium">
<Certificates>
<Certificate name="mydomain.com" storeLocation="LocalMachine" storeName="My" />
</Certificates>
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
<Binding name="HttpsIn" endpointName="HttpsIn" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
<InputEndpoint name="HttpsIn" protocol="https" port="443" certificate="mydomain.com" />
<InputEndpoint name="InputEndpoint1" protocol="https" port="10000" certificate="mydomain.com"/>
<InputEndpoint name="InputEndpoint2" protocol="https" port="10001" certificate="mydomain.com" />
</Endpoints>
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
</WebRole>
</ServiceDefinition>
What Im looking for here is to be able to communicate with one instance over port 10000 and the other over 10001, unless Im mistaken?
If you want to connect directly to each one of the instances without going through the Loadbalancer, then on the same URL you provided, take a look at the Direct port endpoint.
The range of the ports e.g. 10000 to 10010 are allocated sequentially to the instances of your role. Role_0 gets 10000, Role_1 get's 10001 etc. etc.
Hope it helps.