Fun with the Azure Content Delivery Network (CDN)

Fun with the Azure Content Delivery Network (CDN)

Today I made a Content Delivery Network (CDN) where users across the globe can more quickly and reliably download my picture (see below).

The Microsoft Azure Content Delivery Network (CDN) allows you to cache content across the globe to be closer to the user who will consume it so they will experience decreased latency. It also replicates data across the globe and a CDN has global points of presence, which is great for redundancy for your data. Be forewarned, in order to use a Content Delivery Network (CDN), your data must be public, all content is available in the public container and CDN will cache content for only 7 days by default. Also, when setting up a CDN you should try to keep content fairly static since it is meant to be stored, cached, and delivered as fast as possible, so it is not really meant for dynamic content.

I tried this Content Delivery Network (CDN) out by creating my own little network, sharing with my social media, then exploring the data analytics behind my CDN with my Free Trial subscription for Azure. I’ll share with you how I created it and my data analytic results in this article.

Creating a Storage Account

The first step on the road to creating your very own Content Delivery Network (CDN) is to create a storage account. You can create a new storage account from the main menu -> +New -> Azure Marketplace -> Storage -> Storage account – blob, file, table, queue. You should select the binary large object (BLOB) storage option. Here is a screen capture of the storage account I created for my CDN.

Creating a Container

If you want to use a Content Delivery Network (CDN) you need to relate it to a storage account and that account must have a public container for storing your content.  After you create a container (example: folder called images), you have to make it public (a public blob) and add content to your folder. From the container you will get a public accessible URL that is a direct link to your content, but you will share the CDN link URL instead of the direct link to the storage container content.

To create a container, open your storage account for the CDN, then go to Settings -> Container -> + Container. I attached a screen capture of my container below.

Adding Content to Your Container

I created two container folders: images and images2 but decided to add content to only my images folder. Remember this content is public and Azure will give you a URL to the blob storage container, but that is not the URL we will use for our Content Delivery Network (CDN). You can upload your content via the “Upload” button on the container properties.

To upload content to your container, open your storage account for the CDN, then go to Settings -> Container -> Your Container -> Upload. I attached a screen capture of my container and uploaded content below.

Creating a Content Delivery Network (CDN)

Whew, it’s been a lot of work just to get to this point to finally create a Content Delivery Network (CDN). After we create a CDN we are also going to have create an endpoint.

In the past, when creating something awesome in the classic Portal, a lot of these services were bundled and created together in one swoop, but now in the new Portal, every item has to be created separately, priced separately, and configured to be related to work together for success. It was like getting a fast combo meal whereas now it is a la carte.  I would like an Azure cheeseburger with no pickles and onions please!

To create a Content Delivery Network (CDN), go to the main menu -> + New -> Azure Marketplace -> Web + Mobile -> CDN. I attached a screen capture of my CDN below.

Adding an Endpoint

In case you had thought your day was done after creating a CDN, wait… there is more! You now get to create and add an endpoint to your Content Delivery Network (CDN). An endpoint will relate your CDN to your storage BLOB.

To add an endpoint, open your s CDN, then go to General -> Endpoints -> + Endpoint. I attached a screen capture of my endpoint during and after creation.

So, after you create your endpoint you will get a notification saying it may take up to 90 minutes for the global caching.

This would be a nice time to go and take your lunch break or dancercise around the neighborhood to pass the time before testing out the CDN. After 90 minutes you can assume your content is stored and accessible around the world. This means that now my photo from when I was an astronaut has made it across the world and stored in data center locations for quick access… like when you want to download my photo while walking on the Great Wall of China! Instead of passing in/out of international hubs of networks to download from the US location, my photo is now on the fastest most direct download route available to your own eyes.

Custom Domains

I did not tinker here with adding my custom domain like I normally do with Azure products and other projects that I have written about, but this area is where you would add your own branding touch to redirect users to download content from your domain instead of directly from the Content Delivery Network (CDN) DNS URL with whichever clickbait method you got them there.

Data Analytics

I was not short of being disappointed with my user experience of data analytics for my Content Delivery Network (CDN). I reached out to my social media on Facebook and LinkedIn asking my network to click on my image that was delivered by my CDN so I could record the effectiveness of the cache network and explore the provided data analytics.

To view the data analytics for the CDN, you click the “Manage” button on the overview blade for your CDN.

Instead of loading a separate blade in the Azure Portal as one might expect, the data analytics opens in your default web browser. Here is a screen capture of my data analytics home page. I only tested a small image file, so I did not expect nor get very much bandwidth transfer. You can export the data values from the tables on the webpage to an Excel document by the little icon as shown in the screen capture below.

Probably the most relevant eye candy on the data analytics will be the “Cache Statuses” to see what percentage of users are being served content via geographical cache versus the point of origin server (in my example Central US). In my case, only 25% of user requests received a cache copy in their geographical region versus receiving the original copy stored in a central US data center location. This lower than expected cache percentage may be due to the short time period of my project CDN availability experiment (due to my Free Trial subscription expiring) and the lack of geographical disperse users clicking on my content.

Summary

I had a lot of fun creating my Content Delivery Network (CDN) and asking my social network to participate in contributing data analytics for my project. I would had liked to have user performance tested this network over a one-week period versus two days, but I did not have any more time left with my Free Trial subscription. I hope you enjoyed reading my article as I had much fun making this project. Remember technology and websites change every day so it is likely by the time you are reading this, something newer and better has happened with the Azure CDN products.

Kathleen has 15 yrs. of experience analyzing business IT needs and engineering solutions in payments, electric utilities, pharmaceutical, financial, virtual reality, and internet industries with a variety of technologies. Kathleen's project experience has been diverse ranging from executing the business analysis “design phase” to hands-on development, implementation, and testing of the IT solutions. Kathleen and her husband reside in Indiana with no children, instead living along with their fur babies.