Search code examples
azureazure-service-fabric

Hosting multiple websites in Service Fabric


Out of the box in Azure, the Service Fabric template will create a load balancer for your cluster. I have it set up to forward requests from ports 80/443 to a web API backend port which works well.

I would like to now host another web application in the cluster, but I'm not sure how to go about that since port 80 is already tied up with forwarding to another app, and there isn't a way to forward based on host name like in IIS. Would I add a separate load balancer with a different IP that points to the same VM scale set?

Example:

api.mydomain.com:80 -> Stateless web api //Current

web2.mydomain.com:80 -> another stateless web site //Proposed new one

Solution

  • Seems quite possible to me to have this running with a single LB. Generally you need to create a second Public IP address and then add it into Frontend IP Configurations in LB of yours. Finally, create another load balancing rule to have new requests routed to the port where another web-site is running on.

    Here is by the way an article that describes the idea - Load balancing on multiple IP configurations using the Azure portal. Although it's not about VMSS, but at least it shows the conception.