Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Globalizing your App Service with Front Door

0.00/5 (No votes)
23 Sep 2021 1  
In this project, I’ll show you how with relatively little effort and cost your application can serve a global market thanks to Azure Front Door.

The cloud is everywhere, which means your application can be everywhere too! However, in order to get the most out of globally scaled cloud infrastructure, you have to use the right cloud services.

Requirements

For this project you will need:

  • An Azure Account that isn’t on the free tier.
  • Two web apps in separate regions in Azure
  • Access to the Azure CLI either via install or Cloud Shell.

If you want some more context on creating web apps with Front Door, as well as globalizing databases with Cosmos DB, check out my more in-depth ACG project as well.

What is Azure Front Door?

One of the very real, and very cool, advantages of using a cloud computing platform like Microsoft Azure is the global footprint of the many regions, data centers, and edge nodes. In this project, we are going to take advantage of that with just a few simple steps using Azure Front Door and an App Service.

Front Door is a content delivery network (CDN) that takes your application and gives it a robust and high-performing global presence. Azure has thousands of edge nodes, which Front Door can place data on — meaning your application is much closer to the end user. For example, if you have an app service that is deployed to two regions on Azure, the Internet traffic to your app will have to go to either region.

If you use Front Door, the traffic will only need to reach an edge node. And if the request includes data that is either not on the edge node or outdated, only then will the App Service itself be queried.

Advantages

Using Azure Front Door has several advantages, including:

  • High performance: The time for your application to load and respond (latency) is much less, as traffic only needs to get to the edge node through Azure Front Door.
  • High availability: Less data is transferred from your App Service Plans, helping to manage spikes and higher loads in traffic.
  • SSL offloading: Traffic between the user and Front Door is automatically secured with SSL/TLS.
  • Security: Protection against injection attacks, DDoS attacks, and bots.

Creating Azure Front Door

Now you know why you should use Front Door, so let’s look at how, using the Azure CLI.

az network front-door create --resource-group frontDoorRG --name codeproject-frontend --accepted-protocols http https --backend-address appservice-1.azurewebsites.net appservice-2.azurewebsites.net

In this case, the resource group is one you already have, and the two backend addresses are the URLs for your two app services. We are accepting both http and https into the front door instance. You can choose one of the two as well, depending on your requirements.

Next Steps

Even though creating and setting up an Azure Front Door is super easy, the story doesn’t stop here of course. I would recommend considering one or more of the following extra steps:

  • Add a custom domain, such as llamadrama.com or partyhatsrus.com.au.
  • Setting up a geo-filtering policy to block certain regions or countries.
  • Configure a rules engine to control the traffic flow in more details.
  • Use the rules engine to add security headers to prevent browser-based vulnerabilities.

Front Door is a simple and extremely effective service from Azure that will instantly let your web apps cater to a global audience and add a bunch of security features. You pay a monthly, relatively low price as a base , and then data transfers and numbers or rules come on top. Always check for yourself what you need and how it fits in with your budget.

For more information on creating web apps with Front Door, as well as globalizing databases with Cosmos DB, check out this ACG Project.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here