Angha Bhagat
Petabytz
Published in
6 min readSep 14, 2019

--

Content Delivery Network On Azure:-

A content delivery network (CDN) is a distributed network of servers that can efficiently deliver web content to users. CDNs store cached content on edge servers in point-of-presence (POP) locations that are close to end users, to minimize latency.

Azure Content Delivery Network (CDN) offers developers a global solution for rapidly delivering high-bandwidth content to users by caching their content at strategically placed physical nodes across the world. Azure CDN can also accelerate dynamic content, which cannot be cached, by leveraging various network optimizations using CDN POPs. For example, route optimization to bypass Border Gateway Protocol (BGP).

The Benefits of using Azure CDN to deliver web site assets include:

· Better performance and improved user experience for end users, especially when using applications in which multiple round-trips are required to load content.

· Large scaling to better handle instantaneous high loads, such as the start of a product launch event.

· Distribution of user requests and serving of content directly from edge servers so that less traffic is sent to the origin server.

How it works:-

1) A user (Alice) requests a file (also called an asset) by using a URL with a special domain name, such as <endpoint name>.azureedge.net. This name can be an endpoint hostname or a custom domain. The DNS routes the request to the best performing POP location, which is usually the POP that is geographically closest to the user.

2) If no edge servers in the POP have the file in their cache, the POP requests the file from the origin server. The origin server can be an Azure Web App, Azure Cloud Service, Azure Storage account, or any publicly accessible web server.

3) The origin server returns the file to an edge server in the POP.

4) An edge server in the POP caches the file and returns the file to the original requestor (Alice). The file remains cached on the edge server in the POP until the time-to-live (TTL) specified by its HTTP headers expires. If the origin server didn’t specify a TTL, the default TTL is seven days.

5) Additional users can then request the same file by using the same URL that Alice used, and can also be directed to the same POP.

6) If the TTL for the file hasn’t expired, the POP edge server returns the file directly from the cache. This process results in a faster, more responsive user experience.

Create a CDN:-

Step 1 − Login in to your Azure Management Portal.

Step 2 − Click on ‘New’ at bottom left corner.

Step 3 − Select ‘APP Services’ then ‘CDN’.

Step 4 − Click on ‘Quick Create’. The following screen will come up.

You will see three fields in the pop up −

· Subscription − There will be a list of subscriptions you have subscribed to and you can choose from one of them. In this demo, only one option was there in the subscription dropdown, which was ‘BizSpark’, the current subscription.

· Origin Type − This dropdown will ask to select an origin type. The integrated service will have an option of Web Apps, Cloud Services, Storage and Media Services.

· Origin URL − This will show the URLs based on the chosen origin type in the dropdown.

Step 5 − Choose one of the options from each dropdown as needed and click ‘Create’. CDN endpoint is created as show in the following image.

Create CDN for Custom Origin Links:-

In June 2015, CDN was updated with one more feature where users can specify a custom origin. Earlier only Azure services could be linked to CDN, but now any website can be linked to it using this service.

When we are create a CDN service, in the ‘Origin Type’ dropdown, there is an option ‘Custom Origin’ as shown in the following image, and then you can specify the link in the URL field.

Manage CDN:-

Step 1 − Click on the Name of the CDN you want to manage in the list displayed in CDN services.

Step 2 − Click on ‘manage cdn’

Country filtering − You can allow/bock your website in specified countries. This is going to protect your data for better.

Step 3 − When you click on ‘manage cdn’ you will be taken to the following page in a new tab of your browser.

Step 4 − Click on ‘Country Filtering’ from menu items at the top of screen. Click on ‘Add Country Filter’ button as shown in the following image.

Step 5 − Specify the directory and select Allow/block.

Compression − It allows files to be compressed. You can enable/disable compression. Also you can specify the file type.

Step 7 − Click on ‘Cache Setting’ and scroll down to the bottom of the page.

Step 8 − Select ‘Compression Enabled’ and click ‘Update’ button. By default, compression is disabled.

Analytics − You can see very useful figures in this section. For example, number of overall hits or in a specific geographic region. The report will also show how many times requests are served from CDN endpoints and how many of them are going back to the original server.

Step 9 − Click on ‘Analytics’ in menu items at the top of the page. You will see a list of all the reports in the left panel as shown in the following image.

Step 10 − Additionally, you can download the report as an excel file by clicking on the excel icon at the top right corner.

Map a Custom Domain Name:-

You might want to use a custom domain name instead of CDN endpoint that is autogenerated by Azure service. Windows Azure has provided a new feature that allows you to map a custom domain name to his application’s CDN endpoint. Let’s see how it is done in Azure Portal.

Step 1 − Click on ‘Manage Domain’ Button on the bottom horizontal menu.

Step 2 − Enter the custom URL in the text box .

Requirements:-

To use Azure CDN, you must own at least one Azure subscription. You also need to create at least one CDN profile, which is a collection of CDN endpoints. Every CDN endpoint represents a specific configuration of content deliver behavior and access. To organize your CDN endpoints by internet domain, web application, or some other criteria, you can use multiple profiles. Because Azure CDN pricing is applied at the CDN profile level, you must create multiple CDN profiles if you want to use a mix of pricing tiers. For information about the Azure CDN billing structure, see Understanding Azure CDN billing.

Limitations:-

Each Azure subscription has default limits for the following resources:

1) The number of CDN profiles that can be created.

2) The number of endpoints that can be created in a CDN profile.

3) The number of custom domains that can be mapped to an endpoint.

For more information about CDN subscription limits, see CDN limits.

Azure CDN features:-

Azure CDN offers the following key features:

· Dynamic site acceleration

· CDN caching rules

· HTTPS custom domain support

· Azure diagnostics logs

· File compression

· Geo-filtering

--

--