0
votes

In Azure App Services I run a web app handling multiple tenants web traffic. Most of the traffic goes to one single slot. But a few run in separate slots. I wish to consolidate all traffic to the single slot that is accepting traffic with a wildcard expression and consequently removing slots running specific tenants. Moreover ARRAffinity is used.

Example

  • someapp.somehostname.com (somaapp slot)
  • *.somehostname.com (production slot)

Preconditions

  1. The DNS-records are external to Azure. Azure DNS is not used.
  2. As a previous post suggest, removing the CNAME has no impact on which slots that servers incoming requests. It's still the same slot serving the requests. Remove CNAME after Azure has verified the domain
  3. The main slot (production) is configured to receive 100% of the incoming traffic per previous configuration.

Questions

  • Should I remove the custom domain and expect the main slot to take over the traffic?
  • Or, should I add a new custom domain "someapp.somehostname.com" to the production slot?
  • Or both of the above?
2
Your conclusion on CNAME seems to be in accordance with my findings too. CNAME seems to be used for validation (let's say ownership of DNS). Once this is estabilished CNAME removal doesn't seem to affect how traffic is directed in Azure App Services.Martin

2 Answers

1
votes

To be honest, not sure what you are trying to do. However, I think these points might help you when you add a custom domain in the app service.

Deployment slots are live apps with their own host names. You have individual hostnames for each app on each own slots. The SSL certificate in SSL Binding should match the selected custom domain in each slot. If you want to configure the custom domains as your example,

app1.somehostname.com (somaapp slot)
*.somehostname.com (production slot)

For example, you'll create the DNS records like this on Azure DNS(or your DNS zone provider). enter image description here

After my validation, If you remove the awverify.app1 CNAME in the DNS zone, you should still access the web app in the separate slot with hostname app1.somehostname.com because the awverify.app1 is used for domain validation and hostname app1.somehostname.com still can be resolved to your separate slot as there is a CNAME app1 mapping. The result from the DNS checker here. enter image description here

But, if you remove the CNAME records both app1 and awverify.app1 for the hostname app1.somehostname.com, the hostname app1.somehostname.com will be resolved to your production slot as it has wildcard custom domain. enter image description here

In conclusion, If you want to access the web app in the slot, you should have configured a CNAME record mapping to that hostname of the slot URL.

Let me know if you need further help.

0
votes

If I recall correctly removing the one CNAME without a wildcard made that particular slot to stop respond to web requests. It didn’t automatically redistribute the traffic, I think. Additionally, the ARRAffinity token was set.

The solution for me turned out be the following; remove both of them add and the wildcard one again. Obviously this isn’t something you want to do during peak hours.