What is an Azure CDN and how to implement it?

  1. Home
  2. Microsoft
  3. What is an Azure CDN and how to implement it?

In today’s fast-paced digital landscape, delivering content to users in a fast and efficient manner is critical for any online business or organization. Azure CDN (Content Delivery Network) is a service provided by Microsoft Azure that helps in accelerating the delivery of high-bandwidth content to users globally, through a network of strategically placed servers.

With Azure CDN, organizations can enhance the performance of their websites and applications by caching frequently requested content closer to end-users, thereby reducing the latency and increasing the availability of content. In this blog, we will discuss the benefits of Azure CDN, its architecture, and the steps involved in implementing it. We will also explore the different features and pricing models of Azure CDN to help you make an informed decision about whether it’s the right solution for your organization’s needs. So let’s dive in and explore the world of Azure CDN.

What is Azure CDN?

A content delivery network (CDN) can be considered as a distributed network of servers that is responsible for providing web content to users. Azure CDN stores cached content on edge servers in point-of-presence (POP) locations that are close to end-users for minimizing latency. Moreover, it provides developers a solution for providing high-bandwidth content to users by caching their content at strategically placed physical nodes globally. Further, Azure CDN helps website:

  • Firstly, to have better performance and improved user experience for end-users while using applications in which multiple round-trips are needed for loading content.
  • Secondly to perform large scaling for better handling instantaneous high loads like the start of a product launch event.
  • Lastly, for distribution of user requests and serving of content directly from edge servers in order to send less traffic to the origin server.

Glossary for Azure CDN Terminology

  1. CDN (Content Delivery Network): A network of servers that delivers content from edge servers located close to end-users, reducing latency and increasing performance.
  2. Endpoint: A specific CDN URL where content is served from.
  3. Origin: The original source of content, usually a web server or storage account.
  4. Pull CDN: A CDN configuration where content is requested from the origin server by the edge server only when needed.
  5. Push CDN: A CDN configuration where content is uploaded directly to the edge servers.
  6. Cache: A temporary storage location on the edge server where frequently accessed content is stored for faster retrieval.
  7. TTL (Time to Live): The amount of time a cached file is stored on the edge server before it expires and needs to be re-fetched from the origin server.
  8. HTTPS: A secure protocol for transferring data over the internet.
  9. CNAME (Canonical Name): An alias for a domain name.
  10. Query String: The part of a URL that contains data that is passed to the web server as a parameter.

Working of CDN

CDN Overview
Image Source: Microsoft
  • Firstly, a user asks for a file (asset) using a URL with a special domain name. This can be <endpoint name>.azureedge.net. This name is the endpoint hostname or a custom domain. Then, the DNS routes the request to the best-performing POP location.
  • Secondly, the POP requests the file from the origin server if no edge servers in the POP have the file in their cache. Here, the origin server can be an Azure Web App, Azure Cloud Service, or Azure Storage account.
  • Thirdly, the origin server returns the file to an edge server in the POP.
  • After that, an edge server in the POP caches the file and returns the file to the original requestor. Here, the file remains cached on the edge server in the POP until the time-to-live (TTL) defined by its HTTP headers expires. However, if the origin server didn’t define a TTL, then the default TTL is seven days.
  • Now, additional users can request the same file by using the same URL that Alice used and can also be directed to the same POP.
  • Lastly, the POP edge server returns the file directly from the cache if the TTL for the file is not expired. This process results in a faster, more responsive user experience.
Requirements for using Azure CDN
  • For using Azure CDN, you must need at least one Azure subscription and one CDN profile, which is a collection of CDN endpoints. However, every CDN endpoint represents a specific configuration of content delivery behavior and access. 
  • Secondly, use multiple profiles for organizing CDN endpoints by internet domain, web application, or some other criteria. This is because Azure CDN pricing is applied at the CDN profile level. So, you must create multiple CDN profiles if you want to use a mix of pricing tiers. 

What are the features of Azure CDN?

The features that make Azure CDN most useful are:

1. Deep integration

CDN operates smoothly with Azure services, including Web Apps, Media Services, Storage, and Cloud Services. This can be apple to scenarios in just a few clicks.

2. Massive capacity

CDN easily handles sudden traffic spikes and heavy loads using the distributed, global presence. For example, during major product launches, there is no need for new infrastructure costs or capacity concerns.

3. Developer-friendly

Azure APIs and developer tools provide the performance, reliability, and security needed for creating global applications fast. However, these APIs also offer customers the flexibility for optimizing features for availability and performance.

4. Robust security

In Azure CDN, you can lower security threats on the content distribution network like distributed denial-of-service attacks. Moreover, you can optimize security by allowing HTTPS for your domain names without any additional cost or certificate management.

5. Multiple providers

In Azure CDN, you can create and tailor your content delivery strategy using a choice of providers. Moreover, CDN combines with services from Akamai and Verizon thus, allowing customers to choose the right solution for their needs. For example, for load balance over content delivery networks.

6. Advanced analytics

Here, you can obtain insights about customer workflows and business requirements by tracking engagement with the content. Moreover, you can understand the process of customers are receiving and caching assets. And, how it is monitoring traffic the content delivery network using real-time and granular analytics.

Above we have covered the basics of Azure CDN including its features. In the next section, we will learn about integration a storage account and creating a profile and endpoints with CDN.

az-104

Getting started with Azure CDN

1. Integrating an Azure Storage account with Azure CDN

In this, we will enable Azure Content Delivery Network (CDN) to cache content from Azure Storage. 

Creating a storage account

A storage account provides access to Azure Storage services. Moreover, it represents the highest level of the namespace for accessing every Azure Storage service component like Azure Blob, Queue, and Table storage. 

  • Firstly, for creating a storage account, you must be either the service administrator or a co-administrator for the linked subscription.
  • Secondly, select Create a resource on the upper left of the Azure portal. Then, look for Storage account and from the drop down list choose Storage account – blob, file, table, queue. Then select Create.
  • Thirdly, enter the following details in the Create storage account pane:
azure cdn
Image Source: Microsoft
  • After that, leave all other details set to the defaults. Then, select Review + create.
  • Lastly, creating the storage account may take several minutes. After completing, select Go to resource for opening the storage account’s page for the next step.
Enabling Azure CDN for the storage account
  • Firstly, select Blob service > Azure CDN from the left menu on the page for your storage account. 
  • Secondly, enter the following information in the New endpoint section:
storage account
Image Source: Microsoft
  • Lastly, select Create. After creating the endpoint, it appears in the endpoint list.
Enabling additional CDN features

Select the CDN endpoint from the list to open the CDN endpoint configuration page from the storage account Azure CDN page. Here, you can allow additional CDN features for your delivery. The features include compression, query string caching, and geo-filtering.

Enabling SAS

If you want to allow limited access to private storage containers, you can use the Shared Access Signature (SAS) feature of your Azure Storage account. However, SAS here refers to a URI that allows restricted access rights to your Azure Storage resources without revealing the account key. 

Accessing CDN content

For accessing cached content on the CDN, use the CDN URL provided in the portal. However, the address for a cached blob is in format:

http://<endpoint-name>.azureedge.net/<myPublicContainer>/<BlobName>

Removing content from Azure CDN

For removing the content:

  • Firstly, make the container private rather than public.
  • Then, disable or delete the CDN endpoint using the Azure portal.
  • Lastly, modify your hosted service for no longer responding to requests for the object.
    • However, in Azure CDN, you must know that an object remains cached until the time period for the object expires or the endpoint is removed. So, when the time period expires, Azure CDN have right to decide whether the CDN endpoint is still valid and the object is still anonymously accessible. If not, then the object will no longer be cached.

2. Creating an Azure CDN profile and endpoint

In this, we will allow Azure Content Delivery Network (CDN) by creating a new CDN profile. This is basically a collection of one or more CDN endpoints. However, after creating a profile and an endpoint, you can begin delivering content to your customers.

Creating a new CDN profile

A CDN profile refers to a container for CDN endpoints and specifies a pricing tier.

  • Firstly, select Create a resource (on the upper left) in the Azure portal. Here, the New pane appears.
  • Secondly, search for and select CDN. Then, select Create.
  • After that, enter the following values:
azure
Image Source: Microsoft
  • Lastly, select Create for creating the profile.
Creating a new CDN endpoint

After creating a CDN profile, use it for creating an endpoint.

  • Firstly, select in your dashboard the CDN profile that you created in the Azure portal. However, if you are not able to find it, then one option is to open the resource group in which you created it or you can use the search bar. There just enter the profile name, and select the profile from the results.
  • Secondly, select + Endpoint on the CDN profile page. Here, the Add an endpoint pane appears.
  • After that, enter the following setting values:
azure cdn
Image Source: Microsoft
  • Lastly, select Add for creating the new endpoint. After creating the endpoint, it appears in the list of endpoints for the profile.
    • However, the time it takes for the endpoint to transmit depends on the pricing tier selected while creating the profile. Time take by:
      • Standard Akamai is one minute
      • Standard Microsoft in 10 minutes
      • Then, Standard Verizon and Premium Verizon can take up to 30 minutes.
Cleaning up resources

Above we have created a CDN profile and an endpoint in a resource group. However, for deleting the resource group:

  • Firstly, select Resource groups from the left-hand menu in the Azure portal. And, then, select CDNQuickstart-rg.
  • After that, select Delete resource group on the Resource group page and enter CDNQuickstart-rg in the text box. Then, select Delete. Doing this will delete the resource group, profile, and endpoint that you created.

Azure Content Delivery Network (CDN) Pricing

Azure CDN provides secure, reliable content delivery with a broad global reach. However, it offers various pricing options like:

1. Azure Content Delivery Network Standard outbound data transfers

Azure Content Delivery Network Standard refers to a feature-full content delivery network bundle that is capable of controlling content delivery network workloads. Here, customers can choose to use Azure Content Delivery Network Standard from Verizon or Akamai.

2. Azure Standard CDN from Microsoft Rules Engine

Azure Standard CDN from Microsoft creates on standard service with additional Rules Engine rules. In this, five rules are included for free (including the global rule) and additional rules are charged. 

3. Content Delivery Network Premium outbound data transfers

Azure Premium Content Delivery Network creates on the standard service with additional features including rules engine and advanced, real-time analytics.

4. Acceleration Data Transfers

Acceleration Data Transfers, also called Dynamic Site Acceleration (DSA) are used for accelerating the web content that is not cacheable. This can be shopping carts, search results, and other dynamic content. While static object delivery (traditional CDN) uses caching for improving website and download performance, but, DSA enhances routing and network between the requester and content origin. Moreover, DSA can improve the performance of the entire website, and the price for DSA is the same across Standard and Premium profiles.

Final Words

Above we have learned and understood the concept, features, and working of Azure CDN. This content delivery network service of Microsoft is specifically designed for sending audio, video, apps, photos, and other files faster to customers using the servers closest for every user. Moreover, this uses Acceleration Data Transfer for providing dynamic site acceleration of non-cacheable, dynamic content created by your web applications. So, using these services will always be beneficial. To learn more about this use Microsoft Documentation for reference.

az-104 practice tests

Prepare and pass the Microsoft Azure Administrator Associate (AZ-104) Now!

Menu