I have been experimenting with this over the last day and I was able to get it to work on my local environment provided that the service and the website are running under the same domain but in different ports. So that is great news. We can make it work now.
But I'm curious if this is the only way in which it will work because it would mean that we would need to buy a separate domain for each of our environments (eg: dev-oursite.com, qa-oursite.com, oursite.com) where in the past we had only purchased one domain and then used the subdomain (eg: qa.oursite.com) to control which environment we are connecting too.
This would also mean that we would need to open an additional port in the server for the website to be able to talk to the service. This isn't something we have had to do before so its caught us by surprise.
That says that we need to bind the subdomains to the same app but we have two apps (websites running on IIS). One for the angular portion and one for the service portion. That is why I am wondering if we are hosting this incorrectly.
As for the subdomain, so far we have only forwarded subdomains for the specific tenants to the same ip address. So for example;
tenant1.ourdomain.com - goes to the angular site tenant2.ourdomain.com - goes to the angular site
And if you wanted to reach the service then you would go to svc.ourdomain.com.
How have you setup the service and angular website to run on iis?
We tried that, and several other combinations, but none of them have worked. I'm wondering if it's because of how we have setup the website and service on IIS.
In IIS we created two websites. One holds the service and the other holds the angular website.
Currently we are trying to get this running on our QA environment so you would go to qa.ourdomain.com to get to the website. And if you wanted to reach the service then you would go to svcqa.ourdomain.com. If we leave the settings with those values then the website works fine but you need to change the tenant manually.
If we add {TENANCY_NAME} to both the service and website then the site breaks because the website can't find the service. The service only works when you go to svcqa.ourdomain.com.
So I am confused as to how people are hosting this in their environments. Should both the angular and service be a single website in ISS? Or instead of having our service endpoint be a subdomain of ourdomain.com should it have its own separate domain? ourdomainsvc.com?