Search code examples
azureazure-cloud-servicesinternal-load-balancer

Cloud Service ReservedIP mapping error when adding a load balancer


I have below enpoints defined

<Sites>
  <Site name="Internal" physicalDirectory="location">
    <Bindings>
      <Binding name="HttpIn100" endpointName="HttpInLB" />
      <Binding name="HttpIn101" endpointName="HttpInLB" hostHeader="someheader" />
      <Binding name="HttpIn102" endpointName="HttpInLB" hostHeader="someheader" />
      <Binding name="HttpIn103" endpointName="HttpInLB" hostHeader="someheader" />
    </Bindings>
  </Site>
</Sites>

And this is the endpoint

<Endpoints>
      <InputEndpoint name="HttpInLB" protocol="http" port="80" loadBalancer="LB" />
    </Endpoints>

Then in my cscfg file I have

 <NetworkConfiguration>
<VirtualNetworkSite name="Development" />
<AddressAssignments>
  <InstanceAddress roleName="SiteName">
    <Subnets>
      <Subnet name="DMZ-subnet" />
    </Subnets>
  </InstanceAddress>
  <ReservedIPs>
    <ReservedIP name="ipname"/>
  </ReservedIPs>
</AddressAssignments>
<LoadBalancers>
  <LoadBalancer name="LB">
    <FrontendIPConfiguration type="private" subnet="DMZ-subnet" staticVirtualNetworkIPAddress="00.0.00.001" />
  </LoadBalancer>
</LoadBalancers>

When I publish, I get below error

ReservedIP 'ipname' was not mapped to an endpoint. The service definition must contain atleast one endpoint that maps to the ReservedIP.

Appreciate if someone could help me with this.

Many Thanks


Solution

  • ReservedIP is only supported with services containing an external endpoint. What you can do is add an external endpoint and block it with Network Security Groups.

    For example, add following endpoint to your Endpoints tag. Then you could block the port using NSG.

    <InputEndpoint name="Endpoint1" protocol="http" port="8078" />