I've been trying to wrap my head around creating an ILB for a cloud service containing a Web role and a Worker role (with at least 2 instances of each) and I'm stuck. This is the scenario I'm in.
The thing is that I do not want to use powershell because it doesn't fit my case and the research for a working example of a Service Definition and ServiceConfiguration file for the cloud project led me nowhere.
So, as per several sources that basically state the same thing (official documentation, I'll add other links in comments since I've reached the cap) I ended up with the following configuration files:
ServiceDefinition.csdef
<ServiceDefinition name="Test" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
<WebRole name="Web" vmsize="small">...</WebRole>
<WorkerRole name="Worker" vmsize="small">
...
<Endpoints>
<InputEndpoint name="lbEndpoint1" protocol="tcp" localPort="31010" port="31010" loadBalancer="TestILB" />
</Endpoints>
</WorkerRole>
</ServiceDefinition>
ServiceConfiguration.Cloud.cscfg
<ServiceConfiguration serviceName="Test" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6">
<Role name="Web">...</Role>
<Role name="Worker">...</Role>
<NetworkConfiguration>
<LoadBalancers>
<LoadBalancer name="TestILB">
<FrontendIPConfiguration type="private" subnet="Test-ILB-Subnet-Backend" staticVirtualNetworkIPAddress="10.0.0.1" />
</LoadBalancer>
</LoadBalancers>
</NetworkConfiguration>
</ServiceConfiguration>
(The virtual network and subnet are already provisioned in Azure)
Now when I try to run the solution locally, the azure emulator stops with the following error: ".cscfg and .csdef do not match". Also deploying to Azure fails.
Can anyone help me and tell me what I'm doing wrong please?