Azure Storage Account Configure CDN Endpoint

Please go through the following articles to learn more about storage account.

  1. Azure Storage – Basics
  2. Azure Resource Manage Template: Create A Storage Account Using Blank Template
  3. Create a Storage Account and learn how to access It Programmatically
  4. Azure Storage - Creating Blob Container Using Storage Client Library
  5. Azure Storage Account – Create Block Blob Programmatically using C#.Net
  6. Azure Storage Account Why Two Access Keys
  7. Azure – Storage Account – Create a CDN Profile

In the above articles, we have learned about storage account and Content Delivery Network (CDN). We have also created an Azure CDN Profile. In this article, we will learn the following.

  • Create a CDN Endpoint to an existing CDN Profile.
  • Associate a storage account to a CDN Endpoint

Navigate to Azure Management Portal and select the CDN Profile, as shown below.



Currently, there are no CDN Endpoints. Let’s create one using the button Endpoint, as shown in the above screen capture.

Clicking on the Endpoint button will take us to the Add an Endpoint blade.

File Name Description
Name Name of the Endpoint. It should be unique.
Origin type What Azure Service you would like to associate the CDN for. As of now, the available options are given.
  1. Storage
  2. Cloud Service
  3. Web App
  4. Custom Origin
Origin Hostname Depending on the Origin Type, the options in this dropdown change. For Ex: If we select Storage, then automatically, all your Storage Accounts would be displayed.
Origin Path If you want the current Endpoint to pull only the assets of a specific folder, then provide a path. If you want to have the CDN Endpoint retrieve all your contents of your Storage Account, then leave this input box empty.

Below is the screen capture of the "Add an endpoint" screen.



Clicking on "Add" button will create the CDN Endpoint, as shown below.


If you remember, in one of our previous articles, "Azure Storage Account – Create Block Blob Programmatically using C#.NET", we have created a JPG file with the following URL.

  • URL taken from Storage Account
  • URL from CDN End Point

Let’s navigate to the image from the CDN Endpoint.



We have accessed the image from the CDN Endpoint as shown above.

Note - You can only cache the assets to a CDN Endpoint if they are publicly accessible.

Summary

In this article, we have learned the following.

  • How to create a CDN Endpoint.
  • Access the assets from the CDN Endpoint.

Hope you enjoyed reading the article. Your feedback is appreciated.