Multiple-site configuration using Azure Front door
In this post, we show how to host multiple websites in Azure Front Door. Suppose you have 50 websites and you want to redirect the request to the respective web app. Here, we are taking an example of skldev.com. The requirement is skldev.com should be accessible from both www.skldev.com and https://skldev.com. I have registered skldev.com in the azure app service domain. I am assuming you have already provisioned Azure Front Door and now you want to configure the routing and associate WAF policy. The same process should be repeated for every 50 websites. Below are the three core components of the Front Door designer.
Frontend host: It will contain all your website's name/public domain names. It can be both www.contoso.com or contoso.com.
Backend Pools: It will contain all your web apps from the primary and secondary regions.
Routing rules: it will contain routing rules for each website. Suppose you have 50 websites then there will be 50 routing rules.
Creating Frontend host
1. Click on Front Door->Front Door designer and then click on '+' sign under Frontend host.
2. Provide the apex/root domain name under the Custom host name. You will get the error below. The DNS prevents assigning CNAME records at the apex domain. For example, you can create CNAME for ne.skldev.com but not for skldev.com. This problem is solved using alias records on Azure DNS. Details available here.
3. Navigate to Azure DNS zone and click on + Record set.
4. Flow the step as shown in the below image.
5. You can notice, two records will be created as highlighted below.
6. Now you will be able to add root domain as shown below.
7. fsdf sfd fsdf sdf sfd
8. Add CNAME for www.skldev.com in the domain registry.
9. Now add frontend host for ...
10. Now add the custom domain as below.
11. Now create a backend pool.
12. Add a web app as a backend pool.
13. Select the web app name.
14. Assign priority. Here, for north Europe web priority is 1 and for west Europe 2.
15. The backend pool is ready. Now click on Routing rules to add a rule.
16. During rule creation, select the right Backend pool for the right Frontend hosts and click on Save.
17. Select the right backend pool for the right frontend host.
18. we are able to access the web app using the root domain and www as below. If the north Europe web app will down then the Front door will automatically redirect the traffic to west Europe.
19. We can do the DNS mapping as below.
20. For CNAME record.
Cost compared with Traffic Manager and Application Gateway and WAF: Front door can fulfill the requirement of three services (Traffic Manager, Application Gateway, and WAF) alone. Use Azure Calculator to compare the price.