How to enable Azure CDN for your website, cloud app or storage
Overview of the Content Delivery Network (CDN)
Content delivery network (CDN) provides contents cache service to your site or storage at strategically placed locations for maximum performance and bandwidth to the end users.
The benefits of using the CDN :
- Better Speed and user experience for end users who are far from a content source
- Large distributed scale to better handle spontaneous high load
Now we are talking about Azure CDN, where im going to show you how to use Azure CDN on your public web site; like: www.domain.com ( third party host provider).
Step 1: Create a new CDN profile
Azure portal version 2, not the old one
- In the Azure Management Portal, in the upper left, click New. In the New blade, select Media + CDN, then CDN.
- Name: Type a name for your CDN profile
- Location: choose your main data center location, where all your CDN profile information will be stored. Profile location does not have to be in the same location and it has no effect on your CDN endpoint Locations.
- Resource Group: Create or select one resource group for your Azure CDN profile if you haven’t, this will help to organised your future creation.
- Pricing tier: Choose S1 Standard or P1 Premium, more information regarding Azure tier standard or premium please see below.
- Subscription: Select your desire subscription.
- Click to create your new profile.
Standard features
The Standard CDN tier features:
- Easy integration with Azure services such as Storage, Web Apps, and Media Services
- Query string caching
- Custom domain name support
- Country filtering
- Core analytics
- Custom content origins
- HTTPS support
- Load balancing
- DDOS protection
- Fast purge
- Management via REST API
Premium features
The Premium CDN tier includes all of the features of the Standard tier, plus these additional features:
- Customizable, rule-based content delivery engine
- Advanced HTTP reports
- Real-time stats
Azure CDN profile has been created, now time for to create CDN endpoint.
Step 2: Create a new CDN endpoint on Azure
Creating CDN endpoint for our site: www.qureshi.me.
- Click on the profile you plan to add endpoint to. then Click on endpoint plus button then enter the required fields.
- Name: type your desire name which access your cache resource at the domain
- Origin type: drop-down and select custom origin because our site already hosted on third party dedicated servers.
- Origin hostname: Type your website URL address or IP address so Azure CDN can fetch all your data from your hosting server. Reminder: It may take up to 90 minutes to propagate
- Origin path: type the path to the resource of your site you want to cache from azure CDN servers, if you leave blank origin path means you allowing azure CDN to cache any resource at the domain you type in step 5.
- Origin header: type the host header you want the CDN to send with each request, or leave the blank, Azure automatically fetch your custom origin domain.
- Protocol: leave default or blank, however make sure un-checked the protocol which you do not require. at least one protocol must be selected.
- Click Add button to create new CDN endpoint.
Important Message:
The endpoint can take up to 90 minutes for the registration to propagate through the CDN network. before try to access the azure CDN domain you will get 404 error message.
Step 3: How to map Custom Domain to Content Delivery Network (CDN) endpoint
This is also one of the important steps to create a custom domain URL. so map a custom domain to a CDN endpoint in order to use own domain to cached contents, better than using URL provided by Microsoft Azure.
To do this, we require to create a CNAME on our domain registrar DNS and map our custom subdomain to the Azure endpoint.
Register a custom domain for an Azure CDN endpoint
- First Navigate to your domain registrar’s website like godaddy, Digitalberg or 123-reg, and look for DNS management section to add CNAME records. You might find this in a section such as Domain Name, DNS, or Name Server Management.
- Find the section for managing CNAMEs. look for the words CNAME, Alias, or Subdomains.
- Create a new CNAME record that maps your chosen subdomain (for example, www or cdn) to the host name provided in the Add a custom domain blade. my case is CDN.Qureshi.me.
- Return to the Add a custom domain blade (Azure portal), and enter your custom domain, including the subdomain, in the dialog box. For example, enter the domain name in the format www.mydomain.com or cdn.mydomain.com. Azure will verify that the CNAME record exists for the domain name you have entered. If the CNAME is correct, your custom domain is validated and ready to use with your CDN content.
- On Azure Portal, click Browse, then CDN Profiles, then the CDN profile with the endpoint you want to map to a custom domain.
- In the CDN Profile section, click the CDN endpoint with which you want to associate the subdomain.
- At the top of the endpoint section, click the Add Custom Domain button. In the Add a custom domain section, you’ll see the endpoint hostname, obtain from your CDN endpoint, to use in creating a new CNAME record. The format of the hostname address will appear as Qureshi.azureedge.net. You can copy this hostname to use in creating the CNAME record.
- Note that in some cases it can take time for the CNAME record to propagate to name servers on the Internet. If your domain is not validated immediately, and you believe the CNAME record is correct, then wait a few minutes and try again.
Watch Videos for more understanding:
Azure Websites CDN (Content Distribution Network)
What’s new with the Azure CDN – June 2015
Usefull reference from Microsoft:
https://azure.microsoft.com/en-gb/documentation/articles/cdn-create-new-endpoint/
https://azure.microsoft.com/en-gb/documentation/articles/cdn-overview/
Leave a Reply
Want to join the discussion?Feel free to contribute!