In this article, we will provision Azure Front Door using
Arm Template. I have already created two Azure Web Apps which are running in
two different regions i.e West Europe & South East Asia region. We will create
& configure Azure Front Door to direct the traffic to these web apps.
Follow the below steps to deploy Azure Front Door:
- Download this git repo and fill the parameters in azuredeploy.parameters.json as shown below:
- Run the below PowerShell command to provision the AFD.
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "frontDoorName": { "value": "ashishfrontdoortest" }, "dynamicCompression": { "value": "Enabled" }, "backendPools1": { "value": { "name": "backendpool1", "backends": [ { "address": "ashishtest1.azurewebsites.net", "httpPort": 80, "httpsPort": 443, "weight": 50, "priority": 1, "enabledState": "Enabled" }, { "address": "ashishtest2.azurewebsites.net", "httpPort": 80, "httpsPort": 443, "weight": 50, "priority": 2, "enabledState": "Enabled" } ] } } } }
Login-AzureRmAccount $ResourceGroupName = "" #Enter Resource group Name $AzuredeployFileURL="" #File path of azuredeploy.json $AzuredeployParametersFile = "" #File path of azuredeploy.parameters.json Set-AzureRmContext -SubscriptionId "" #Subscription ID New-AzureRmResourceGroupDeployment -ResourceGroupName $ResourceGroupName -TemplateFile $AzuredeployFileURL -TemplateParameterFile $AzuredeployParametersFile
Once Azure front Door is deployed, go to browser
and navigate the Frontend host URL of
AFD. Your request will be routed to Azure Web App.
Go to Azure Portal to check the AFD configuration. Click on the Front Door Designer from left navigation bar and open Frontends/domains.
Here you can enable SESSION AFFINITY & WEB APPLICATION FIREWALL
Now open backend pools as illustrated below. Here you can update your backend pools configuration.
Last section is routing rule which maps your frontend host and a matching URL path pattern to a specific backend pool.
Here you can configure URL rewrite, Caching, Dynamic compression, Query String caching behavior etc.
Is it possible to deploy AFD with Sitecore 9.3 environment. I have few doubts with AFD & Sitecore.
ReplyDeleteI have shared my requirements in your Linkedin Profile
ReplyDeleteHi Deepak,
ReplyDeleteCurrently, Sitecore is not supporting Azure Front Door. Please refer this KB: https://kb.sitecore.net/articles/332787
But let me know your doubts..
We have 2 CD instances hosted in Australia East & UK West. We are looking for the configuration so that requests from Australia will go to Australia CD while UK requests to UK instance. Also we need to configure WAF & CDN for Sitecore environment.
ReplyDeleteYou can follow the below steps:
ReplyDelete1. Add your hostname in your Frontend.
2. You need to add both the instances in your Backend pools with Priority 1 & weight 100.
3. Then Add routing rules for your hostname and enable the Cache there. AFD is having same caching mechanism like Azure CDN standard microsoft.
4.To configure rule for routing go to Rules engine configuration, Add rule like If Geo Match=Austrlia, Then Routing Configuration forward to Desired Backend Pool.
5. To enable WAF, you need to create a WAF policy and then attach to your AFD.
In case of any doubts, let me know or share meeting invite on er.ashishsharma@outlook.com
To enable WAF policy what I need to do? I have created an WAF Policy and I need to put it in ARm template so that it gets deployed on Prod env. I can send the azuredeploy and parameters file if you can have a look.
Delete