Table of contents
1.
Introduction
2.
Working of CDN
3.
Benefits
4.
Limitations
5.
Integration
5.1.
Creating a Storage Account
5.2.
Enabling CDN for the Storage account
5.3.
Remove Content From CDN
5.4.
Clean Up Resources
6.
Frequently Asked Questions
6.1.
What is CDN?
6.2.
What are the advantages of Azure CDN?
6.3.
What is Azure?
6.4.
What is Cloud?
6.5.
What is DNS?
7.
Conclusion
Last Updated: Mar 27, 2024
Easy

Azure Content Delivery Network

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

The Azure CDN or Content Delivery Network is a distributed network of servers that are used to deliver web content to users efficiently. CDN servers try to minimize communication latency by storing the cached content on the edge servers in POP or point of presence locations close to the end-user. 

The Azure Content Delivery Network minimizes the latency by storing the cached data at physical nodes strategically placed across the globe. Azure CDN can also accelerate the content that cannot be cached. This blog will discuss the benefits and the working of the Azure CDN. We will also learn to integrate Azure storage accounts with Azure CDN.

Working of CDN

Working of CDN

Let us look at how CDNs work.

  • Let us assume John requests a file or an asset using a URL. In a CDN, the DNS routes the request to the nearest point of presence or POP location. 
  • If the POP does not have the file in the cache, it will request the file from the main server. The main server can be an Azure Storage Account, Azure Cloud Service, Azure Web App, etc.
  • The main server now returns the file to the POP server.
  • Now the POP server will cache the file and return it to the user or, in our case John. The cached file will remain at the POP server until the TTL or time to live that is specified by the HTTP headers expires. The default TTL is seven days. 
  • Users other than John can also request the same file using the URL used by John. The POP server directly returns the file from the cache until the TTL, thus decreasing the time latency. 

Benefits

Some of the benefits of using Azure CDN are,

  • Azure CDN provides an improved user experience and better performance. 
  • Azure CDN has extensive scaling for better handling of high instantaneous loads. For example, high rapid loads might be created in case of a product launch event.
  • Azure CDN helps reduce traffic directed towards the main or origin server.
  • Users can also dynamically accelerate their sites using Azure CDN.
  • Azure CDN provides HTTPS custom domain support.
  • Azure CDN also offers some additional features such as Geo-Filtering, Azure Diagnostic Logs, File Compression, and CDN Caching Rules. 

Limitations

Even though Azure CDN sounds like a potent tool, there are a few limitations,

  • A limited number of CDN profiles can be created in Azure CDN. 
  • A limited number of endpoints can be created in Azure CDN.
  • Only a limited number of domains can be mapped to an endpoint using Azure CDN.

Integration

In this section, we will look at the steps to integrate an Azure storage account with Azure CDN.

Creating a Storage Account

Before anything, you will need to create an Azure Storage account,

Go to the Azure Portal and click on Create a Resource button in the top left corner. 

Now search for Storage Account and then select Create.
 

storage account

Now enter the following details in the Create Storage Account pane,
Resource Group: <Enter Resource Group Name>
Storage Account Name: Enter a unique name containing 3-24 lowercase letters and numbers.
Region: Select any of the Azure Regions

Now create the new storage account. This may take several minutes.

Enabling CDN for the Storage account

To enable CDN on the Storage account, we will have to go to the Storage Account page. From there, select Azure CDN under the Blob Service option in the left panel. 

CDN for storage account

Now enter all the information accordingly in the New Endpoint section and click Select. You will be able to view the endpoint in the endpoint list.

You can also enable additional CDN features, Enable SAS, and Access CDN Content.

Remove Content From CDN

If you do not want to cache a file in the Azure CDN, you can use any one of the following steps,

  • Make the container private from public.
  • You may delete the Azure CDN endpoint using the Azure Portal.
  • You may also modify your hosted service such that it does not respond to requests for the specific file.

Clean Up Resources

You can easily clean up the CDN by simply deleting the created resource manually or using the following Azure PowerShell command,

Remove-AzResourceGroup -Name <ResourceGroupName>

 

You can also manually delete the Storage account from the dashboard in the top corner.

Frequently Asked Questions

What is CDN?

CDN is a distributed server network that delivers web content to users efficiently. CDN servers try to minimize communication latency by storing the cached content on the edge servers in POP or point of presence locations close to the end-user. CDN stands for Content Delivery Network. 

What are the advantages of Azure CDN?

The Azure Content Delivery Network minimizes the latency by storing the cached data at physical nodes strategically placed across the globe. Azure CDN can also accelerate the content that cannot be cached.

What is Azure?

Azure is one of the largest Cloud Services provided by Microsoft. Azure is generally used for application management. Azure provides the clients with Platform as a Service(PaaS), Software as a Service(SaaS), and Infrastructure as a Service(IaaS).

What is Cloud?

Cloud is nothing but the servers that are accessed over the internet. It also consists of the software and the database used to run these servers.

What is DNS?

DNS stands for Domain Name System. Domain Name System is a service used to convert a hostname to an IP address. DNS is an application layer protocol that helps the clients and the servers communicate.

Conclusion

This blog covered all the necessary points about Azure CDN. We further looked at the working and the features of the Azure CDN. We also learned to integrate Azure Storage Account with Azure CDN.

Do check out our blogs on object-oriented programming and data structures

Don’t stop here. Check out Coding Ninjas for more unique courses and guided paths. Also, try Coding Ninjas Studio for more exciting articles, interview experiences, and fantastic Data Structures and Algorithms problems.

Live masterclass