0
votes

I have an Azure Cloud Service with 2 instances, each running a WCF service. We have a need to run a command that's basically "www.mywcfservice.com/refreshcache" periodically, right now I can RDP into each individual instance and run local jobs, but I'd like to put those jobs in something like the Azure scheduler instead.

Right now, if I call "www.mywcfservice.com/refreshcache", I get 1 of the 2 machines at random, and that individual machine will perform the refresh.

If I RDP into each VM and perform an IPConfig I get IP's, but from outside the VM's I cannot access the specific machines.

What I'd like to know is, how can I access EACH VM's specific endpoint and run the job? Are the individual VM's exposed?

1

1 Answers

0
votes

The InstanceInputEndpoint allows you to access a specific role instance, and can be configured to span a series of ports, each port getting mapped to an instance. You'd set it up with something like this in your configuration:

<Endpoints>
  <InstanceInputEndpoint name="InstanceEndpoint" protocol="tcp" localPort="8000">
    <AllocatePublicPortFrom>
      <FixedPortRange min="8000" max="8010"  />
    </AllocatePublicPortFrom>
  </InstanceInputEndpoint>
</Endpoints>

With a WCF service, you might have some more work to do around address filtering (see this blog post which shows an AddressFilterMode service behavior).