# Azure Front Door in front of a static website

- URL: https://baeke.info/2019/01/12/azure-front-door-in-front-of-a-static-website/
- Author: Geert Baeke
- Published: January 12, 2019 (updated March 12, 2025)
- Topics: azure, web, azure, cdn, frontdoor, hosting, https, loadbalancing, ssl, web
- Outdated: It shows the preview of Azure Front Door (classic), which is being retired in favour of Front Door Standard and Premium.

In the [previous post](https://baeke.info/2019/01/11/static-site-hosting-on-azure-storage-with-a-custom-domain-and-tls/), I wrote about hosting a simple static website on an Azure Storage Account. To enable a custom URL such as [https://geertbaeke.wordpress.com](https://geertbaeke.wordpress.com), you can add Azure CDN. If you use the Verizon Premium tier, you can configure rules such as a http to https redirect rule. This is similar to hosting static sites in an Amazon S3 bucket with [Amazon CloudFront](https://aws.amazon.com/cloudfront/) although it needs to be said that the http to https redirect is way simpler to configure there.

On Twitter, [Karim Vaes](https://twitter.com/kvaes) reminded me of the [Azure Front Door](https://azure.microsoft.com/en-us/services/frontdoor/) service, which is currently in preview. The tagline of the Azure Front Door service is clear: *“scalable and secure entry point for fast delivery of your global applications”*.

![](https://baeke.info/_astro/2019-01-image-9.erhgcFRr_MmkGu.webp)

*Azure Front Door Service Preview*

The Front Door service is quite advanced and has features like global HTTP load balancing with instant failover, SSL offload, application acceleration and even application firewalling and DDoS protection. The [price](https://azure.microsoft.com/en-us/pricing/details/frontdoor/) is lower that the Verizon Premium tier of Azure CDN. Please note that preview pricing is in effect at this moment.

Configuring a Front Door with the portal is very easy with the Front Door Designer. The screenshot below shows the designer for the same website as the [previous post](https://baeke.info/2019/01/11/static-site-hosting-on-azure-storage-with-a-custom-domain-and-tls/) but for a different URL:

![](https://baeke.info/_astro/2019-01-image-10.Inwbr6MT_24ODef.webp)

*Front Door Designer*

During deployment, you create a name that ends in azurefd.net (here geba.azurefd.net). Afterwards you can add a custom name like deploy.baeke.info in the above example. Similar to the Azure CDN, Front Door will give you a Digicert issued certificate if you enable HTTPS and choose **Front Door managed**:

![](https://baeke.info/_astro/2019-01-image-11.BbAZvW8e_Z27y77G.webp)

*Front Door managed SSL certificate*

Naturally, the **backend pool** will refer to the https endpoint of the static website of your Azure Storage Account. I only have one such endpoint, but I could easily add another copy and start load balancing between the two.

In the **routing rule**, be sure you select the frontend host that matches the custom domain name you set up in the frontend hosts section:

![](https://baeke.info/_astro/2019-01-image-12.BuIsvbgX_Zuxi0s.webp)

*Routing rule*

It is still not as easy as in CloudFront to redirect http to https. For my needs, I can allow both http and https to Front Door and redirect in the browser:

```
if(window.location.href.substr(0,5) !== 'https'){
 window.location.href = window.location.href.replace('http', 'https');
}
```

Not as clean as I would like it but it does the job for now. I can now access [https://deploy.baeke.info](https://deploy.baeke.info) via Front Door!
