Tutorial: Use Azure CDN to enable a custom domain with SSL for a static website
This tutorial is part two of a series. In it, you learn to enable a custom domain endpoint with SSL for your static website.
The tutorial shows how to use Azure CDN to configure the custom domain endpoint for your static website. With Azure CDN, you can provision custom SSL certificates, use a custom domain, and configure custom rewrite rules all at the same time. Configuring Azure CDN results in additional charges, but provides consistent low latencies to your website from anywhere in the world. Azure CDN also provides SSL encryption with your own certificate. For information on Azure CDN pricing, see Azure CDN pricing.
In part two of the series, you learn how to:
- Create a CDN endpoint on the static website endpoint
- Enable custom domain and SSL
Before you begin this tutorial, complete part one, Tutorial: Host a static website on Blob Storage.
Sign in to the Azure portal
Sign in to the Azure portal to get started.
Create a CDN endpoint on the static website endpoint
- Open the Azure portal in your web browser.
- Locate your storage account and display the account overview.
- Select Azure CDN under the Blob Service menu to configure Azure CDN.
- In the New Endpoint section, fill out the fields to create a new CDN endpoint.
- Enter an endpoint name, such as mystaticwebsiteCDN.
- Enter your website domain as the hostname for your CDN endpoint.
- For the origin hostname, enter your the static website endpoint. To find your static website endpoint, navigate to the Static website section for your storage account and copy the endpoint (remove the preceding https:// )
- Test your CDN endpoint by navigating to mywebsitecdn.azureedge.net in your browser.
- Additionaly verify by navigating to the New Endpoint under settings, origin to see if the Origin type is set to Custom Origin and Origin hostname displays the Static webiste endpoint name.
Enable custom domain and SSL
Create a CNAME record with your domain name provider to redirect your custom domain to the CDN endpoint. The CNAME record for the www subdomain should be similar to the following:
In the Azure portal, click on the newly created endpoint to configure the custom domain and the SSL certificate.
Select Add custom domain and enter your domain name, then click Add.
Select the newly created custom domain mapping to provision an SSL certificate.
Set Custom Domain HTTPS to ON. Select CDN Managed to have Azure CDN manage your SSL certificate. Click Save.
Test your website by accessing your website url.
In part two of this tutorial, you learned how to configure a custom domain with SSL in Azure CDN for your static website.
Follow this link to learn more about static website hosting on Azure Storage.
Send feedback about: