title: How to host multiple Web API services on the same port in service fabric in Azure
body: <p>I have a single Service Fabric cluster in Azure that is currently hosting an API on port 443. My cluster is using the standard 5-node minimum setup. All nodes are Windows VMs. If I want to host a second API that listens on the same port, what possible solutions do I have?</p>
  
  <p>For example:</p>
  
  <pre><code>serviceA.myDomain.com:443 -&gt; deploys to all nodes, listens on port 443
  serviceB.myDomain.com:443 -&gt; can't deploy to all nodes since port 443 is already in use.
  </code></pre>
  
  <p>These are all Stateless services using the .NET framework (not .NET core) and I'm currently using Owin as my communication listener, so it looks like HttpSys might not be an option for port sharing because most references I've looked at are using .NET core when leveraging it.</p>
  
  <p>It looks like Service Fabric has the concept of node placement restraints, documented here: <a href="https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-resource-manager-cluster-description#node-properties-and-placement-constraints" rel="nofollow noreferrer">Node Placement Restraints</a></p>
  
  <p>One thought I have is adding additional nodes, placing restraints on certain services to deploy to specific node types and then using something like <a href="https://azure.microsoft.com/en-us/services/api-management/" rel="nofollow noreferrer">Azure API Management</a> to direct traffic to the correct API. Would this be a viable option? If not, what are some suggested approaches I might take?</p>