Logo
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
EPL Standings
 
 
Windows Azure

Accessing the Surveys Application : Content Delivery Network

7/11/2011 5:52:44 PM
The Windows Azure Content Delivery Network (CDN) allows you to have binary large object (BLOB) content cached at strategic locations around the world in order to make that content available with the maximum possible bandwidth to users and minimize any latency. The CDN is designed to be used with BLOB content that is relatively static. For the Surveys application, the developers at Tailspin have identified two scenarios where they could use the CDN:

The CDN enables you to have data that is stored in BLOBs cached at strategic locations around the world.

  • Tailspin is planning to commission a set of training videos with titles such as “Getting Started with the Surveys Application,” “Designing Great Surveys,” and “Analyzing your Survey Results.”

  • Hosting the custom images and style sheets that subscribers upload.

In both of these scenarios, users will access the content many times before it’s updated. The training videos are likely to be refreshed only when the application undergoes a major upgrade, and Tailspin expects subscribers to upload standard corporate logos and style sheets that reflect corporate branding. Both of these scenarios will also account for a significant amount of bandwidth used by the application. Online videos will require sufficient bandwidth to ensure good playback quality, and every request to fill out a survey will result in a request for a custom image and style sheet.

One of the requirements for using the CDN is that the content must be in a BLOB container that you configure for public, anonymous access. Again, in both of the scenarios, the content is suitable for unrestricted access.

For information about the current pricing for the CDN, visit the Windows Azure Platform website at http://www.microsoft.com/windowsazure/offers/.


Note:

For data cached on the CDN, you are charged for outbound transfers based on the amount of bandwidth you use and the number of transactions. You are also charged at the standard Windows Azure BLOB storage rates for the transfers that move data from BLOB storage to the CDN. Therefore, it makes sense to use the CDN for relatively static content. With highly dynamic content, you could, in effect pay double, because each request for data from the CDN triggers a request for the latest data from BLOB storage.


The Solution

To use the CDN with the Surveys application, Tailspin will have to make a number of changes to the application. The following sections describe these changes. This section describes the planned solution; the current version of the Surveys application does not include the use of the CDN.

1. Setting the Access Control for the BLOB Containers

Any BLOB data that you want to host on the CDN must be in a BLOB container with permissions set to allow full public read access. You can set this option when you create the container by calling the BeginCreate method of the CloudBlobContainer class or by calling the SetPermissions method on an existing container. The following code shows an example of how to set the permissions for a container.

protected void SetContainerPermissions(String containerName)
{
CloudStorageAccount cloudStorageAccount =
CloudStorageAccount.FromConfigurationSetting(
"DataConnectionString");
CloudBlobClient cloudBlobClient =
cloudStorageAccount.CreateCloudBlobClient();

CloudBlobContainer cloudBlobContainer =
new CloudBlobContainer(containerName, cloudBlobClient);

BlobContainerPermissions blobContainerPermissions =
new BlobContainerPermissions();
blobContainerPermissions.PublicAccess =
BlobContainerPublicAccessType.Container;
cloudBlobContainer.SetPermissions(blobContainerPermissions);
}

Notice that the permission type used to set full public access is BlobContainerPublicAccessType.Container.

2. Configuring the CDN and Storing the Content

You configure the CDN at the level of a Windows Azure storage account through the Windows Azure Developer Portal. After you enable CDN delivery for a storage account, any data in public BLOB containers is available for delivery by the CDN.

The application must place all the content to be hosted on the CDN into BLOBs in the appropriate containers. In the Surveys application, media files, custom images, and style sheets can all be stored in these BLOBs. For example, if a training video is packaged with a player application in the form of some HTML files and scripts, all of these related files can be stored as BLOBs in the same container.


Note:

You must be careful if scripts or HTML files contain relative paths to other files in the same BLOB container because the path names will be case sensitive. This is because there is no real folder structure within a BLOB container, and any “folder names” are just a part of the file name in a single, flat namespace.


3. Configuring URLs to Access the Content

Windows Azure allocates URLs to access BLOB data based on the account name and the container name. For example, if Tailspin created a public container named “video” for hosting their training videos, you could access the “Getting Started with the Surveys Application” video directly in Windows Azure BLOB storage at http://tailspin.blob.core.windows.net/video/gettingstarted.html. This assumes that the gettingstarted.html page is a player for the media content. The CDN provides access to hosted content using a URL in the form http://<uid>.vo.msecnd.net/, so the Surveys training video would be available on the CDN at http://<uid>.vo.msecnd.net/video/gettingstarted.html.

Figure 1 illustrates this relationship between the CDN and BLOB storage.

Figure 1. The Content Delivery Network


You can configure a CNAME entry in DNS to map a custom URL to the CDN URL. For example, Tailspin might create a CNAME entry to make http://files.tailspin.com/video/gettingstarted.html point to the video hosted on the CDN. You should verify that your DNS provider configures the DNS resolution to behave efficiently; the performance benefits of using the CDN could be offset if the name resolution of your custom URL involves multiple hops to a DNS authority in a different geographic region.


Note:

In addition to creating the CNAME entry for your custom domain name in the tool you use for managing your DNS entries, you must also configure the custom domain name in the storage account settings. You should use the Custom Domains section on the Summary Page in the Windows Azure Developer Portal to complete this task.


When a user requests content from the CDN, Windows Azure automatically routes their request to the closest available CDN endpoint. If the BLOB data is found at that endpoint, it’s returned to the user. If the BLOB data is not found at the endpoint, it’s automatically retrieved from BLOB storage before being returned to the user and cached at the endpoint for future requests.

4. Setting the Caching Policy

All BLOBs cached by the CDN have a time-to-live (TTL) period that determines how long they will remain in the cache before the CDN goes back to BLOB storage to check for updated data. The default caching policy used by the CDN uses an algorithm to calculate the TTL for cached content based on when the content was last modified in BLOB storage. The longer the content has remained unchanged in BLOB storage, the greater the TTL, up to a maximum of 72 hours.

If the BLOB data is not found at the endpoint, you will incur Windows Azure storage charges when the CDN retrieves the data from blob storage.


Note:

The CDN retrieves content from BLOB storage only if it is not in the endpoint’s cache, or if it has changed in BLOB storage.


You can also explicitly set the TTL by using the CacheControl property of the BlobProperties class. The following code example shows how to set the TTL to two hours.

blob.Properties.CacheControl = "max-age=7200";
Other -----------------
- Accessing the Surveys Application : Authentication and Authorization
- Working with Data in the Surveys Application : Using SQL Azure
- Using Cloud Services : Collaborating on Contact Management - Exploring Contact Management and CRM Applications
- Using Cloud Services : Collaborating on Event Management - Exploring Event Management Applications
- Working with Data in the Surveys Application : Displaying Data (part 3) - Displaying Questions & Displaying the Summary Statistics
- Working with Data in the Surveys Application : Displaying Data (part 2) - Session Data Storage
- Working with Data in the Surveys Application : Displaying Data (part 1) - Paging through Survey Results
- Microsoft Azure: Enterprise Application Development - Queue Storage
- Microsoft : Azure Enterprise Application Development : Web Role
- Microsoft Azure: Enterprise Application Development - Worker Roles
- Working with Data in the Surveys Application : Saving Survey Response Data
- Working with Data in the Surveys Application : Testing and Windows Azure Storage
- Working with Data in the Surveys Application : A Data Model for a Multi-Tenant Application
- Enterprise Application Development : Azure Monitoring and Diagnostics
- Enterprise Application Development : Azure Diagnostics­ under the hood & Enabling diagnostic logging
- Building a Scalable, Multi-Tenant Application for Windows Azure : Scaling the Surveys Application
- Building a Scalable, Multi-Tenant Application for Windows Azure : Scaling Applications by Using Worker Roles
- Building a Scalable, Multi-Tenant Application for Windows Azure : On-Boarding for Trials and New Customers
- Introduction to SQL Azure : Creating our database
- Introduction to SQL Azure : Migrating schema and data
 
 
Most view of day
- Windows Phone 8 : Developing for the Phone - Application Lifecycle (part 2) - Navigation
- Microsoft Dynamic GP 2010 : Providing clean vendor information by properly closing Purchase Orders, Protecting against information loss by printing Fixed Asset Reports
- Microsoft Lync Server 2010 : Planning for Voice Deployment - Dial Plan
- Tracking Change in Vista : Turning on the audit policy, Exploring the Vista Event Log
- Managing Client Protection : Using Windows Defender (part 2)
- System Center Configuration Manager 2007 : Operating System Deployment - Native Mode
- Microsoft Lync Server 2013 : Office 365 and Lync Online - System Requirements
- Securing the Workstation : Applying the Castle Defense System (part 6) - Working with external access - Working with the Windows Firewall with Advanced Security
- Microsoft Exchange Server 2010 : Working with SMTP Connectors, Sites, and Links (part 2) - Viewing and Managing Active Directory Site Link Details
- Managing SharePoint 2010 with Windows PowerShell : Managing Permissions in SharePoint 2010, Managing Content Databases in SharePoint 2010
Top 10
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 3) - Creating IPv4 DHCP Scopes
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 2) - Installing DHCP Server and Server Tools
- Windows Server 2012 : DHCP,IPv6 and IPAM - Exploring DHCP (part 1)
- Windows Server 2012 : DHCP,IPv6 and IPAM - Understanding the Components of an Enterprise Network
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 3) - Translating Text with the Mini Translator
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 2) - Translating a Word or Phrase with the Research Pane
- Microsoft OneNote 2010 : Using the Research and Translate Tools (part 1) - Setting Options for the Research Task Pane, Searching with the Research Task Pane
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 2) - Ending a Linked Notes Session, Viewing Linked Notes
- Microsoft OneNote 2010 : Doing Research with Linked Notes (part 1) - Beginning a Linked Notes Session
- Microsoft OneNote 2010 : Doing Research with Side Notes (part 3) - Moving Side Notes to Your Existing Notes
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro