Configure Azure Front Door for a highly available global web application
Dimitar Iliev ??
Azure AI Solutions Architect ● B. Sc. Computer Science and Engineering ● 7 x Microsoft Certified ● 23 x Microsoft Applied Skills ● Speaker ● Generative AI ● Scrum Master Certified ● 1 x GitHub Certified
What is Azure Front Door?
According to the official MS Docs (Azure Front Door | Microsoft Learn) Azure Front Door helps us deliver higher availability, lower latency, greater scale, and more secure experiences to our users.
Azure Front Door (classic) is a global entry-point which can help us create highly available and secure web applications. For more information on Azure Front Door (classic) I suggest you read the following official MS Docs (Azure Front Door (classic) | Microsoft Learn).
Preparing the App Services
For this example, I have already created two App Services in Azure.
The first App Service name is webapptech01 while the second App Service name is webapptech02. The configuration for both is the same except that webapptech01 is in the North Europe region while webapptech02 is in the West Europe region.
Now let’s see how we can implement Azure Front Door and access our App Services through it.
Setting up Azure Front Door
Go to the Azure portal and search for 'Front Door'.
Click on the 'Create front door and CDN profiles' button.?
Next select the 'Explore other offerings' option and from below choose the 'Azure Front Door (classic)' option to start creating the Front Door.
In the 'Basics' section fill in the details as below:
Next, go to the 'Configuration' tab. You will see the next setup:
Click on the button to add Frontends/domains.?
Fill in the following information:
The next step is to add Backend pools. Click on the + button.?
Here we need to add our two App Services to the backends. To do this click on '+ Add a backend' button and do the same for both of the applications.?
After adding the backends we should end up with the following configuration:?
The last thing to do is to add Routing rules. Click on the button to add a new rule:
领英推荐
Fill in the details as below:
The final state of our configuration should look like the following:
Finish creating the Front Door resource.
Now let’s go to our Front Door resource.
Click on the Frontend host URL and observe that everything is working as expected.
Now let’s do a couple of tests to demonstrate how all of this works.
Go to the webapptech01 and stop the service.
After a few minutes, we will see that our service (webapptech01) is no longer running.
Refresh the page where we opened the Frontend host URL. You will see that it’s still working correctly. That is because our webapptech02 is still running and we’re being redirected to it.
Now let’s stop webapptech02 as well.
Visit webapptech02 URL and confirm that it is no longer running.
Refresh the page where we opened the Frontend host URL. Observe that now it is not working. That is because we stopped both of our services.
Return to webapptech01 and start the App Service again.
Open the Frontend host URL again and observe that it started working again. That’s because one of our services is running, so it redirects us to that service.
Perfect. Our Azure Front Door is working as expected and is redirecting us to the service that is running when the other one isn't which makes us have a highly available global web application.
Thanks for sticking to the end of another article from?"Iliev Talks Tech".?#ilievtalkstech