Skip to main content

Azure Front Door Deployment using ARM Template


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:

  1. Download this git repo and fill the parameters in azuredeploy.parameters.json as shown below:
  2. {
      "$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"
              }
            ]
          }
        }
      }
    }
    
    
  3. Run the below PowerShell command to provision the AFD.
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.








Comments

  1. Is it possible to deploy AFD with Sitecore 9.3 environment. I have few doubts with AFD & Sitecore.

    ReplyDelete
  2. I have shared my requirements in your Linkedin Profile

    ReplyDelete
  3. Hi Deepak,

    Currently, Sitecore is not supporting Azure Front Door. Please refer this KB: https://kb.sitecore.net/articles/332787

    But let me know your doubts..

    ReplyDelete
  4. 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.

    ReplyDelete
  5. You can follow the below steps:

    1. 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

    ReplyDelete
    Replies
    1. 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

Post a Comment

Thanks for your comment. In case of any concerns, please contact me at er.ashishsharma@outlook.com

Popular posts from this blog

Comparison between Azure Application Gateway V1 and V2

Microsoft has announced new version of Azure Application Gateway and its Web Application Firewall module (WAF). In this article, we will discuss about the enhancements and new highlights that are available in the new SKUs i.e. Standard_v2 and WAF_v2. Enhancements and new features: Scalability: It allows you to perform scaling of the number of instances on the traffic. Static VIP: The VIP assigned to the Application Gateway can be static which will not change over its lifecycle. Header Rewrite: It allows you to add, remove or update HTTP request and response headers on application gateway. Zone redundancy: It enables application gateway to survive zonal failures which allows increasing the resilience of applications. Improved Performance: Improvement in performance during the provisioning and during the configuration update activities. Cost: V2 SKU may work out to be overall cheaper for you relative to V1 SKU. For more information, refer Microsoft p...

Install Solr as an Azure App Service

After Sitecore 9.0.2, Solr is a supported search technology for Sitecore Azure PAAS deployments. In this article, we will install SOLR service 8.4.0 in Azure App Service for Sitecore 10. 1. Create Azure App Service Login to Azure and create Azure App service. Make sure Runtime stack should be Java. 2. Download Solr Download Solr 8.4.0 from https://archive.apache.org/dist/lucene/solr/ Extract the files and add the below web.config file in the Solr package. <?xml version="1.0" encoding="UTF-8"?> <configuration>  <system.webServer>      <handlers>      <add  name="httpPlatformHandler"            path="*"            verb="*"            modules="httpPlatformHandler"            resourceType="Uns...

Configure a Backup for your Azure App Service

The Backup feature in Azure App Service allows us to easily create app backups manually or on a schedule. You can restore the app to a snapshot of a previous state by overwriting the existing app or restoring to another app. Refer the below steps to schedule your backup: 1. Go to your App service and click on Backups from left Navigation bar. 2. Click on Configure and select your Azure storage account and container to store your backup. Then configure the schedule to start your backup as illustrated below. 3. Once everything is configured you can see backup status as shown below. 4. Once backup is succeeded, you can see the next scheduled backup details. Exclude files from your backup If you want to exclude few folders and files from being stored in your backup, then you can create _backup.filter file inside D:\home\site\wwwroot folder of your web app. Let’s assume you want to exclude Logs folder and ashish.pdf file. Then create _backup.filter file and add...

Export BACPAC file of SQL database

When you need to create an archive of an Azure SQL database, you can export the database schema and data to a BACPAC file. A BACPAC file can be stored in Azure blob storage or in local storage in an on-premises location and later imported back into Azure SQL Database or into a SQL Server on-premises installation. Let's learn some of the ways to export BACPAC file. Export BACPAC using Azure Portal Open your SQL Database and select Export. Fill the parameters as shown below. Select your storage account container & enter your SQL Server admin login. To check the status of your database export. Open your SQL Database server containing the database being exported. Go to Settings and then click Import/Export history Export BACPAC using SSMS Login Azure SQL Database by SSMS. Right-click the database -> Tasks -> Export Data-tier Application Save the .bacpac file into local disk. Export BACPAC using SQLPackage There is a command line tool that you can also choose to ...

Difference between Azure Front Door Service and Traffic Manager

Azure Front Door Service is Microsoft’s highly available and scalable web application acceleration platform and global HTTP(s) load balancer. Azure Front Door Service supports Dynamic Site Acceleration (DSA), SSL offloading and end to end SSL, Web Application Firewall, cookie-based session affinity, URL path-based routing, free certificates and multiple domain management. In this article, I will compare Azure Front Door to Azure Traffic Manager in terms of performance and functionality. Similarity: Azure Front Door service can be compared to Azure Traffic Manager in a way that this also provides global HTTP load balancing to distribute traffic across different Azure regions, cloud providers or even with your on-premises. Both AFD & Traffic Manager support: Multi-geo redundancy: If one region goes down, traffic routes to the closest region without any intervention. Closest region routing: Traffic is automatically routed to the closest region. Differences: Azu...