Ante Miličević
December 10, 2023

Connect Azure Front Door with AKS services within the private VNet network

Dive into a straightforward guide on linking Azure Front Door with AKS services inside a private VNET. Improve web app delivery and boost Azure security with these simple steps.


In this blog, I will show you how to set up Azure Front Door with AKS within a private VNet network. The main objective of this blog is to show you how you can connect Azure Front Door with privately deployed AKS services. In this blog, I will guide you with an example using a basic Nginx image and Kubernetes service.

On a high level, these are necessary steps considering you have deployed your private AKS cluster.

  • Deploy nginx and corresponding private nginx service
  • Deploy Azure Front Door and connect Azure Front Door with private nginx service
  • Test everything

Deploy nginx and corresponding private nginx service

Deploy simple Nginx deployment

<pre class="codeWrap"><code>cat &lt;&lt;EOF | kubectl apply -f -
apiVersion: apps/v1
kind: Deployment
 name: deploy
     app: deploy
 replicas: 1
       app: deploy
     - name: deploy
       image: nginx
       - containerPort: 80

Deploy private nginx Kubernetes service

<pre class="codeWrap"><code>cat &lt;&lt;EOF | kubectl apply -f -
apiVersion: v1
kind: Service
 name: nginx-lb
 annotations: "true" "true" nginx-pls aks-subnet
   app: deploy
   - protocol: TCP
     port: 80
 type: LoadBalancer

With this yaml file, we are creating a private link service called “nginx-pls”. We need to create a private link service in order to connect Azure Front Door with private service within the private network. To learn more about private link service and how it works, check out this blog.

<span id="test" class="kool-class" style="color: #E4474C; background-color: #E9E9E6; border-radius: 5px; padding: 5px;" fs-test-element="test"> aks-subnet</span> is referring to a subnet where a private IP address of Kubernetes nginx service will be deployed. You can choose any subnets inside your virtual network where is your AKS deployed for this.

<img src="" alt="Azure-Front-Door-with-AKS-1">

You can check in “Private Link Center” by clicking “Private link services” if your nginx private link service was successfully deployed.

<img src="" alt="Azure-Front-Door-with-AKS-2">

Deploy Azure Front Door

For this tutorial, we will deploy Azure Front Door with the Custom Create option

<img src="" alt="Azure-Front-Door-with-AKS-3">

We need to use the “Premium” Tier option because it supports private links while the “Standard” option does not support it. We are using private links while we are creating Kubernetes yaml file for an nginx service since it will be a private service within the private network.

<img src="" alt="Azure-Front-Door-with-AKS-4">

We will skip the “Secrets” option in this tutorial

In the following screenshots, we will create Endpoint, add a route, create an origin group, create an origin, and connect our nginx service with Azure Front Door.

Also, in order to have a working Nginx, a few things need to be taken care of. The liveliness probe should be the “GET” method, and “Forwarding protocol” should be “HTTP only”.

<img src="" alt="Azure-Front-Door-with-AKS-5">

<img src="" alt="Azure-Front-Door-with-AKS-6">

<img src="" alt="Azure-Front-Door-with-AKS-7">

<img src="" alt="Azure-Front-Door-with-AKS-8">

<img src="" alt="Azure-Front-Door-with-AKS-9">

You can find a “Host name” with following steps. Go to “Private Link Center” → “Private link services” → “Alias”. “Origin host header” should be left as default auto-completion.

<img src="" alt="Azure-Front-Door-with-AKS-10">

After that, create an Azure Front Door Service and wait for a while to be deployed.

When Azure Front Door is successfully deployed, you need to approve the private link service. You can do it by following these steps:

  • go to “Private Link Center”
  • Choose your private link services
  • Select “Private endpoint connection” in the menu, and select “Approve”

<img src="" alt="Azure-Front-Door-with-AKS-11">


To see if everything is properly working, we need to copy the URL address of an endpoint and we should see the default nginx page.

  • go to Azure Front Service you deployed
  • “Front Door manager”
  • copy an URL of the endpoint

<img src="" alt="Azure-Front-Door-with-AKS-12">

<img src="" alt="Azure-Front-Door-with-AKS-13">


In this tutorial, we deployed Azure Front Door Service which had a public endpoint that is connected to the private endpoint of a sample Kubernetes nginx application.

Azure Front Door is a powerful managed service and you can leverage a lot of its functionalities such as:

  • Global Load Balancing: Azure Front Door distributes incoming traffic across multiple backends in different regions, ensuring high availability and low-latency access for users worldwide.
  • Traffic Routing and URL-based Routing: Front Door allows you to route traffic to different backends based on various criteria such as URL path, host, or headers. It enables you to define flexible routing rules to direct traffic to specific endpoints.
  • SSL/TLS Termination: Front Door terminates SSL/TLS connections, allowing you to offload the encryption and decryption workload from your backend servers. It simplifies the management of SSL certificates and improves the performance of your application.
  • Web Application Firewall (WAF): Azure Front Door integrates with Azure Web Application Firewall, providing protection against common web vulnerabilities and attacks such as SQL injection, cross-site scripting (XSS), and more. WAF rules can be customized to meet your application's security requirements.
  • Application Performance Optimization: Front Door includes features like connection pooling, dynamic site acceleration, and content caching to enhance the performance of your web applications. It caches static content closer to end-users, reducing latency and improving response times.
  • SSL Policy Management: You can define and enforce SSL/TLS protocols and cipher suites to ensure secure communication between Front Door and your backend services. It allows you to configure security policies to meet compliance requirements.
  • Health Probes and Monitoring: Front Door continuously monitors the health of your backend services by sending probes to check their availability. It automatically reroutes traffic away from unhealthy endpoints, ensuring high reliability.
  • Session Affinity: Front Door supports session affinity, allowing you to maintain user sessions by routing subsequent requests from the same client to the same backend. It is useful for stateful applications that require session persistence.
  • Scalability and Autoscaling: Azure Front Door scales automatically based on incoming traffic patterns and can handle high-volume workloads. It dynamically adjusts capacity to ensure optimal performance and minimize costs.
  • Analytics and Logging: Front Door provides detailed analytics and logging capabilities, giving you insights into traffic patterns, performance metrics, and potential security threats. You can monitor and analyze data to make informed decisions.
  • Custom Domain and SSL Certificate Management: You can associate custom domain names with Azure Front Door and manage SSL certificates for secure connections.
  • Front Door simplifies the process of certificate management and renewal.
  • High Availability and Disaster Recovery: Azure Front Door is designed for high availability and provides redundancy across multiple Azure regions. It offers built-in failover capabilities to ensure continuous operation in case of failures or disasters.

Facing Challenges in Cloud, DevOps, or Security?
Let’s tackle them together!

get free consultation sessions

In case you prefer e-mail first:

Thank you! Your message has been received!
We will contact you shortly.
Oops! Something went wrong while submitting the form.
By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information. If you wish to disable storing cookies, click here.