We are setting up the hosting of a static website within an Azure Storage Account that will use an Azure CDN to add a custom domain with SSL connectivity to the static website. A CDN endpoint must be created to connect to the Azure Storage Account’s (containing the static website’s assets) primary endpoint URL.

Previous steps in Setting up a custom domain website being hosted from an Azure storage account:

1. To find and save the Storage Account’s Primary web endpoint URL, navigate to the Azure Portal > Storage Account > Settings > Static Website > Primary endpoint

NOTE: We’re not using the Storage Account’s  Blob service “Azure CDN” setting to integrate a new CDN endpoint with the storage account because (at the time of writing this blog), the default Origin Hostname URL provided (demostaticwebsitesa.blob.core.window.net) will NOT work without being able to add HTTP Rules. We want to use the storage account’s web endpoint, which is created when the static website feature is activated in the storage account. The new CDN endpoint will be generated from the CDN profile blade instead of from within the storage account settings.

2. Add the CDN endpoint to storage account:

  • Navigate to CDN profile > Overview > + Endpoint > Add an endpoint
    • We are using an existing CDN profile which is a Verison Premium CDN
      • To learn how to set up an Azure CDN profile, read here.
  • Add in the new CDN endpoint name <your CDN endpoint name>
    • Note that the <your CDN endpoint name>.azureedge.net is the new Endpoint’s URL
  • For Origin type, select Custom origin
    • Do not use the Storage option as it will only show the blob storage endpoint – not the static website endpoint)
  • Paste in the storage account’s Primary Endpoint URL (saved in Step 1 above).
    • The Origin host header will automatically be populated from the added Origin hostname
  • Select Add

3. The new endpoint has now been added to the CDN profile:

Continuing Steps to Setting up a custom domain website being hosted from an Azure storage account: