Complete Guide to SSL Termination and End-to-End SSL Encryption with Detailed Configuration Examples
SSL termination means that Azure Front Door decrypts incoming HTTPS traffic from clients, processes the request, and then forwards it to the backend origin. The connection between Front Door and the backend can be either HTTP (unencrypted) or HTTPS (encrypted).
Benefits: Reduced backend CPU load, centralized certificate management, ability to inspect and modify traffic, better performance through connection reuse.
End-to-end SSL ensures that traffic remains encrypted throughout the entire path from the client to the backend origin. Azure Front Door terminates the client SSL connection and establishes a new SSL connection to the backend.
Benefits: Maximum security, compliance with strict security requirements, protection against man-in-the-middle attacks, encrypted data in transit at all points.
HTTPS request from client to Front Door
Front Door decrypts with its certificate
WAF, routing, caching decisions
HTTP or HTTPS to origin server
| Aspect | SSL Termination Only | End-to-End SSL |
|---|---|---|
| Security Level | Good - Encrypted client to Front Door | Excellent - Encrypted throughout entire path |
| Performance | Better - Less encryption overhead | Good - Additional SSL handshake to backend |
| Backend Requirements | HTTP server sufficient | HTTPS server with valid certificate required |
| Compliance | Suitable for most scenarios | Required for high-security/regulated environments |
| Certificate Management | Only Front Door certificate needed | Both Front Door and backend certificates needed |
az afd profile create \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--sku Standard_AzureFrontDoor
This command creates a new Azure Front Door profile, which serves as the top-level container for all Front Door resources. The profile defines the pricing tier and regional deployment model for your Front Door instance.
Standard_AzureFrontDoor - Basic features, lower costPremium_AzureFrontDoor - Advanced security, Private Link supportaz afd endpoint create \
--endpoint-name "myEndpoint" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--enabled-state Enabled
This creates an endpoint within your Front Door profile. An endpoint represents a logical grouping of domains and their associated configuration. Each endpoint gets a unique hostname in the format: [endpoint-name]-[hash].z01.azurefd.net
Enabled - Endpoint is active and receiving trafficDisabled - Endpoint is inactiveaz afd custom-domain create \
--custom-domain-name "myCustomDomain" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--host-name "www.example.com" \
--certificate-type ManagedCertificate \
--minimum-tls-version TLS12
This command adds a custom domain to your Front Door profile and configures SSL termination. Azure Front Door will automatically provision and manage SSL certificates for your domain using its integration with certificate authorities.
ManagedCertificate - Azure manages certificate lifecycleCustomerCertificate - You provide and manage your own certificateTLS10 - Supports TLS 1.0 and above (legacy)TLS12 - Requires TLS 1.2 and above (recommended)After creating the custom domain, you must validate ownership by adding a TXT record to your DNS. Azure will provide the specific TXT record values to add.
az afd origin-group create \
--origin-group-name "myOriginGroup" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--probe-request-type GET \
--probe-protocol Http \
--probe-interval-in-seconds 30 \
--probe-path "/" \
--sample-size 4 \
--successful-samples-required 3 \
--additional-latency-in-milliseconds 50
An origin group contains one or more backend origins and defines how health probes are conducted. This configuration sets up health monitoring to ensure traffic is only sent to healthy backends.
GET - Standard HTTP GET requestHEAD - HTTP HEAD request (headers only)Http - Unencrypted health checksHttps - Encrypted health checksaz afd origin create \
--origin-group-name "myOriginGroup" \
--origin-name "myOrigin" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--host-name "backend.example.com" \
--origin-host-header "backend.example.com" \
--http-port 80 \
--https-port 443 \
--weight 100 \
--priority 1 \
--enabled-state Enabled
This creates a backend origin server within the origin group. The origin represents your actual web server or application that will serve the content. For SSL termination, we specify both HTTP and HTTPS ports, allowing Front Door to communicate with the backend over either protocol.
az afd route create \
--route-name "myRoute" \
--endpoint-name "myEndpoint" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--origin-group "myOriginGroup" \
--supported-protocols Http Https \
--patterns-to-match "/*" \
--forwarding-protocol HttpOnly \
--link-to-default-domain Enabled \
--https-redirect Enabled
This route configuration enables SSL termination by accepting HTTPS traffic from clients but forwarding only HTTP traffic to the backend. The --forwarding-protocol HttpOnly parameter ensures that after SSL termination at Front Door, traffic to the backend is unencrypted.
Http - Accept HTTP traffic onlyHttps - Accept HTTPS traffic onlyHttp Https - Accept both protocolsHttpOnly - Always use HTTP to backend (SSL termination)HttpsOnly - Always use HTTPS to backend (end-to-end SSL)MatchRequest - Use same protocol as client requestWith this configuration, Azure Front Door will terminate SSL connections from clients and forward unencrypted HTTP traffic to your backend servers, reducing their computational load while maintaining security for client connections.
End-to-end SSL encryption ensures maximum security by maintaining encrypted connections throughout the entire request path. This is essential for sensitive data, compliance requirements, and zero-trust security models.
az afd route update \
--route-name "myRoute" \
--endpoint-name "myEndpoint" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--forwarding-protocol HttpsOnly \
--supported-protocols Https
This updates the existing route to implement end-to-end SSL encryption. By setting --forwarding-protocol HttpsOnly, Front Door will establish encrypted HTTPS connections to the backend servers after terminating the client SSL connection.
az afd origin update \
--origin-group-name "myOriginGroup" \
--origin-name "myOrigin" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--host-name "backend.example.com" \
--origin-host-header "backend.example.com" \
--certificate-name-check-enabled true \
--enabled-state Enabled
This configuration ensures that the backend origin is properly set up for HTTPS connections. The --certificate-name-check-enabled parameter enables certificate validation, ensuring that the backend server's SSL certificate is valid and trusted.
true - Validate backend SSL certificate (recommended for production)false - Skip certificate validation (only for testing/development)For end-to-end SSL to work properly, your backend servers must have valid SSL certificates. The certificate's Common Name or Subject Alternative Name must match the origin-host-header value.
# First, import your custom certificate to Azure Key Vault
az keyvault certificate import \
--vault-name "myKeyVault" \
--name "myCustomCert" \
--file "/path/to/certificate.pfx" \
--password "certificatePassword"
This command imports a custom SSL certificate into Azure Key Vault. Using custom certificates gives you full control over certificate management, including extended validation (EV) certificates, specific certificate authorities, or certificates with custom extensions.
az afd custom-domain update \
--custom-domain-name "myCustomDomain" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--certificate-type CustomerCertificate \
--secret-source AzureKeyVault \
--secret-version "latest" \
--vault-id "/subscriptions/{subscription-id}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/myKeyVault" \
--secret-name "myCustomCert"
This updates your custom domain to use the imported certificate from Key Vault instead of an Azure-managed certificate. This approach provides more control over certificate properties and is required for certain compliance scenarios.
AzureKeyVault - Certificate stored in Azure Key Vaultaz afd security-policy create \
--security-policy-name "mySSLSecurityPolicy" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--domains "/subscriptions/{subscription-id}/resourceGroups/{rg}/providers/Microsoft.Cdn/profiles/myFrontDoorProfile/customDomains/myCustomDomain" \
--waf-policy "/subscriptions/{subscription-id}/resourceGroups/{rg}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/myWAFPolicy"
This creates a security policy that applies Web Application Firewall (WAF) rules to your SSL-enabled domains. Security policies help protect against common web vulnerabilities and can enforce additional SSL/TLS security requirements.
Your Azure Front Door is now configured for end-to-end SSL encryption. Traffic is encrypted from client to Front Door, and from Front Door to your backend servers, providing maximum security.
az afd custom-domain show \
--custom-domain-name "myCustomDomain" \
--profile-name "myFrontDoorProfile" \
--resource-group "myResourceGroup" \
--query '{name:name, validationState:validationState, certificateType:tlsSettings.certificateType, minimumTlsVersion:tlsSettings.minimumTlsVersion}' \
--output table
This command retrieves the current SSL certificate status for your custom domain. It shows certificate type, validation state, and TLS version settings, helping you monitor certificate health and configuration.
az afd log analytic \
--resource-group "myResourceGroup" \
--profile-name "myFrontDoorProfile" \
--metrics "OriginHealthPercentage,OriginRequestCount" \
--granularity "PT1H" \
--start-time "2024-01-01T00:00:00Z" \
--end-time "2024-01-02T00:00:00Z"
This retrieves analytics data about origin health and request patterns, which can help identify SSL-related connectivity issues between Front Door and your backend servers.
OriginHealthPercentage - Backend server health percentageOriginRequestCount - Number of requests to backendsRequestCount - Total requests to Front DoorResponseSize - Response payload sizesPT1M - 1 minute intervalsPT1H - 1 hour intervalsP1D - 1 day intervals