<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Azure Support &#187; Blobs</title>
	<atom:link href="http://www.azuresupport.com/tag/blobs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.azuresupport.com</link>
	<description>Windows Azure Tutorial</description>
	<lastBuildDate>Mon, 25 Apr 2011 10:32:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Using Azure CDN (Content Delivery Network) In Your App</title>
		<link>http://www.azuresupport.com/2010/02/azure-cdn-content-delivery-network-app/</link>
		<comments>http://www.azuresupport.com/2010/02/azure-cdn-content-delivery-network-app/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 09:06:32 +0000</pubDate>
		<dc:creator>azuresupport</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Blobs]]></category>
		<category><![CDATA[CDN]]></category>

		<guid isPermaLink="false">http://www.azuresupport.com/?p=556</guid>
		<description><![CDATA[The Windows Azure CDN is a convenient way for application developers to minimize latency that geographically dispersed application users will experience. As of  as of February 2010, the Azure CDN is currently in CTP and incurring no charges. Who Needs a CDN? Application users that are geographically far away from the data center where a [...]]]></description>
			<content:encoded><![CDATA[<p>The Windows Azure CDN is a convenient way for application developers to minimize latency that geographically dispersed application users will experience. As of  as of February 2010, the Azure CDN is currently in CTP and incurring no charges.</p>
<h3>Who Needs a CDN?</h3>
<p>Application users that are geographically far away from the data center where a file they are attempting to access resides will experience a lag due to the distance the data has to travel to reach their client. CDN&#8217;s attempt to solve this issue by caching copies of the file in various geographic locations across the globe, the user attempting to access the file will be served from the nearest data center to minimize the latency. Latency is an especially acute problem for large files that are streamed to users (notably video files), but with the declining cost of CDN&#8217;s they are more and more commonly used to deliver smaller static files &#8211; the theme files for AzureSupport.com (such as the logo and css files) are all served via the Amazon CloudFront CDN.</p>
<h3>Introducing the Windows Azure CDN</h3>
<p>The Azure CDN features 20 edge locations (geographic points were the cached data is served from) for blobs which are in public containers. See <a href="http://www.azuresupport.com/2010/08/windows-azure-cdn-locations/">Azure CDN Locations</a> for a full listing of the geographic locations</p>
<h3>Using The Azure CDN</h3>
<p>The Windows Azure CDN is tightly integrated into Azure Storage, to enable it simply navigate to the appropriate storage account in the Azure developer portal and click Enable CDN, this will turn on the CDN for that storage account although there may be a delay of up to 60 minutes before it is available for use. <br />
 Once the CDN is functioning the only change will be the URL from which your blobs are accessible, the URL will be in the following format  &#8211; http://&lt;guid&gt;.vo.msecnd.net/&lt;container name&gt;/.</p>
<h3>TTL &#8211; Time to Live</h3>
<p>One issue you will have to contend with is the caching of the blobs. If you need to update the blob (ie replace the file with an updated version) the new version will not be accessable by users until the cache has expired and the Azure CDN refreshes the cache from the actual blob in the storage container. The expiry time for the cache is know as the TTL (Time To Live). The default for Azure is 72 hours, however this can be manually adjusted by setting the CloudBlob.Attributes.Properties.CacheControl property of the CloudBlob object in your code. It should be noted that setting the TTL to a short time will reduce the effectiveness of the CDN as the CDN will only reduce the request time when the blob is cached at an edge location.<br />
 It should be noted that blobs which are deleted will still be available at any edge location it is cached at until the TTL expires.</p>
<h3>Registering a Custom Domain for Azure CDN</h3>
<p>If the default URL does not appeal, you can register a custom domain as the CDN URL for that storage account (note that only one custom domain can be registered per CDN endpoint). To register a custom domain, navigate to your storage account, if it has the Azure CDN enabled it will have a URL in the format http://&lt;guid&gt;.vo.msecnd.net/ listed under Custom Domains. Click &#8216;Manage&#8217; to the right of this URL. On the Custom Domain for CDN Endpoint page, enter the custom domain and click Generate Key. The next page will show a CNAME record which you will have to enter for the domain and then Validate to ensure you are the domain&#8217;s admin or owner. <br />
 Once the domain&#8217;s ownership has been validated you can create a CNAME record for your chosen domain and then point that to your default Azure CDN URL, this will then allow you to use your custom domain for all URL&#8217;s.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.azuresupport.com/2010/02/azure-cdn-content-delivery-network-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Azure Storage to an Azure Application</title>
		<link>http://www.azuresupport.com/2010/02/add-azure-storage-to-an-azure-application/</link>
		<comments>http://www.azuresupport.com/2010/02/add-azure-storage-to-an-azure-application/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 07:14:36 +0000</pubDate>
		<dc:creator>azuresupport</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Azure Storage]]></category>
		<category><![CDATA[Blobs]]></category>

		<guid isPermaLink="false">http://www.azuresupport.com/?p=532</guid>
		<description><![CDATA[We previously looked at Creating an Azure App in Visual Studio and then Deploying the App on Azure . The application we built was a very simple one requiring no storage, we now turn our attention to extending the demo application to include Azure Storage. For this example we will use the blob storage in [...]]]></description>
			<content:encoded><![CDATA[<p>We previously looked at <a href="http://www.azuresupport.com/2010/01/azure-tutorial-building-a-hello-azure-app-in-visual-studio/">Creating an Azure App in Visual Studio</a> and then <a href="http://www.azuresupport.com/2010/01/publish-and-deploy-an-application-on-windows-azure/">Deploying the App on Azure </a>. The application we built was a very simple one requiring no storage, we now turn our attention to extending the demo application to include Azure Storage. For this example we will use the blob storage in a simple Web Role.</p>
<h3>Creating Local Blob Storage</h3>
<ol>
<li>First we need to set up connection string to the Azure storage account. In the Cloud Service project in the Visual Studio Solution Explorer double-click the role which will use Azure storage in the Roles folder. This should bring up the configuration page for the Role. Navigate to the Settings tab and click &#8216;Add Setting&#8217; , then provide a name for the setting (such as StorageConnectionString) , set the type to ConnectionString and click the &#8216;&#8230;&#8217; button in the Value field. This will bring up the Storage Connection String dialog. Initially we will be developing and testing the storage on the local server so select the Use Development Storage radio button and click OK:	<br />
 <img class="alignnone size-full wp-image-540" title="ScreenHunter_01 Feb. 02 13.06" src="http://64.207.144.116/wp-content/uploads/2010/02/ScreenHunter_01-Feb.-02-13.061.gif" alt="" width="531" height="454" /> </li>
<li>In the code behind for the page which will interact with the blob storage add the following declaration to the top of the page to import the relevant namespaces (for a larger project this should be done in the web.config)
<div class="code">using Microsoft.WindowsAzure;<br />
 usingMicrosoft.WindowsAzure.StorageClient;</div>
</li>
<li>Add an instance of an Azure storage account :
<div class="code">CloudStorageAccount account = CloudStorageAccount.FromConfigurationSetting(&#8220;StorageConnectionString&#8221;);</div>
</li>
<li>Create a CloudBlobClient object which will perform the main blob functions against the storage account. Then use the BlobClient object to create a CloudBlobContainer (all blobs must be stored in a container):
<div class="code">CloudBlobClient blobClient = account.CreateCloudBlobClient();<br />
 CloudBlobContainer container = blobClient.GetContainerReference(&#8220;hellocloud&#8221;);</div>
</li>
<li>Now we need to set the viewing permissions for the blob, in this example we will be setting the blob for public access so it can be viewed by anyone. This is done at the container level by creating a BlobContainerPermissions object and setting the object&#8217;s permissions to public and then passing the object to the container&#8217;s SetPermissions method.
<div class="code">BlobContainerPermissions containerPermissions = new BlobContainerPermissions();<br />
 containerPermissions.PublicAccess = BlobContainerPublicAccessType.Container;<br />
 container.SetPermissions(containerPermissions);</div>
</li>
<li>Create an CloudBlockBlob object which will manage the individual blob and then set the URI to access the blob:
<div class="code">CloudBlockBlob blob;<br />
 blob = container.GetBlockBlobReference(Guid.NewGuid().ToString());</div>
</li>
<li>For this example we will simply place a string in the blob (however it could be used for a file using the Upload file method of the blob object.
<div class="code">blob.UploadText(&#8220;AzureSupport text&#8221;)</div>
</li>
<li>The blob is now available at the URI:
<div class="code">blob.Uri.ToString()</div>
</li>
</ol>
<h3>Move the Blob Storage to Azure online storage</h3>
<ol>
<li>Navigate to your Windows Azure developer portal, and click &#8220;New Service&#8221; (which is located above the Windows Azure tab).</li>
<li>Click Storage Account</li>
<li>Enter a Service Label and click Create</li>
<li>On the Create a Service &#8211; Storage Account page, enter a Public Storage Account Name and then configure the Storage Account Affinity Group (it is recommended that you create a new affinity group if there is not existing groups). Click &#8216;Create&#8217; and the storage should be created. </li>
<li>We will now modify the Connection String for the Visual Studio project to point to this account. To do this we need to repeat Step 1 of <strong>Create Local Blob Storage </strong>above, but enter select the Enter Storage Credentials radio button and enter the Account Name we just created and the  Access Key (which is the Primary Access Key shown in the Azure developer portal). You can also specify the endpoints for accessing the storage:<br />
 <img class="alignnone size-full wp-image-546" title="ScreenHunter_02 Feb. 02 15.08" src="http://64.207.144.116/wp-content/uploads/2010/02/ScreenHunter_02-Feb.-02-15.081.gif" alt="" width="590" height="384" /></li>
<li>Now you can deploy your application as shown in the <a href="../2010/01/publish-and-deploy-an-application-on-windows-azure/">Deploying the App on Azure</a> tutorial. You can also enable the <a href="http://www.azuresupport.com/2010/02/azure-cdn-content-delivery-network-app/">Azure CDN </a>for your app.</li>
</ol>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.azuresupport.com/2010/02/add-azure-storage-to-an-azure-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

