I have two Azure web apps:
- webapp1.azurewebsites.net
- webapp2.azurewebsites.net
webapp1 is my live website, which is configured with a custom domain, www.example.com.
I want to divert all incoming traffic so that it goes to webapp2, rather than webapp1.
My plan to do this was:
- Add the custom domain 'www.example.com' to webapp2.
- Change the DNS CNAME record for www.example.com so that it points to webapp2.azurewebsites.net (instead of webapp1.azurewebsites.net).
However, this approach doesn't work; When I try to add the custom domain name to webapp2 using portal.azure.com, I get the error: 'The host name www.example.com' is already assigned to another Azure website'.
It's important to ensure that there is no downtime in this transition, so removing the custom domain name from webapp1 before adding it to webapp2 isn't an option.
Any ideas on how I can solve this problem?