Click here to Skip to main content
15,885,435 members
Articles / Hosted Services / Azure
Article

Globalizing your App Service with Front Door

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
23 Sep 2021CPOL3 min read 2.5K   2  
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.

This article is a sponsored article. Articles such as these are intended to provide you with information on products and services that we consider useful and of value to developers

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.

Image 1

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.

Image 2

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Lars is an Azure instructor with A Cloud Guru and Pluralsight, author of various literary publications, trainer of cloud computing, Microsoft MVP, community leader, aspiring Microsoft Azure expert, and part-time classic car collector. He has been a part of the software development community for the past 20 years and co-organizes the DDD Melbourne community conference, organizes developer events with Microsoft, and also runs a part-time car restoration business. He has spoken at numerous technical events around the world, and is an expert in Australian Outback Internet. You can connect with Lars on his blog at http://larsklint.com or via Twitter at @larsklint.

Comments and Discussions

 
-- There are no messages in this forum --