Windows Azure CloudDrive - Creating a Web Role that mounts the CloudDrive from Azure Storage and reads text files (Part 2 of 2, 22 minutes)
This is part 2 of 2 screencasts I recorded that helps a Microsoft .NET developer use the new Windows Azure CloudDrive feature -
- For Part 1, Creating a VHD and Uploading it to Azure Storage (Part 1 of 2, 30 minutes) – click here.
- For the Summary entry on blog.ehuna.org, click here.
Once the VHD file has been uploaded to Azure Storage you can use the Azure SDK to cache it in your web role instance and mount it - you then have a NTFS hard-drive in the cloud where you can use the standard System.IO classes to read and write files.
For more articles, screencasts and tips check out www.ehuna.org - follow me on twitter.com/ehuna
Download the Visual Studio 2010 RC VB.NET sample projects used in the videos here:
http://blog.ehuna.org/files/Visual-Studio-Solution-AzureSpeed1.zip (134 KB)
Here’s what is covered in the video:
• 00:00 - Introduction / Overview (see notes here).
○ Mounting a VHD in the Azure fabric, reading text files and spitting them out
• 00:50 - New Visual Studio 2010 RC cloud project with one web role
○ MyVHDWebRole
• 01:40 - Settings in ServiceDefinition.csdef with LocalResource "on-disk" cache
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="MyVHDWebRole" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="MyVHD_WebRole">
<InputEndpoints>
<InputEndpoint name="HttpIn" protocol="http" port="90" />
</InputEndpoints>
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" />
<Setting name="AzureStorageAccount" />
<Setting name="AzureStorageKey" />
<Setting name="BlobStorageEndpoint" />
<Setting name="QueueStorageEndpoint" />
<Setting name="TableStorageEndpoint" />
<Setting name="BlobContainePCLDrives" />
<Setting name="VHDDriveName" />
</ConfigurationSettings>
<LocalResources>
<LocalStorage name="MyCloudDriveCache"
cleanOnRoleRecycle="true"
sizeInMB="30" />
</LocalResources>
</WebRole>
</ServiceDefinition>
• 02:40 - Settings in ServiceConfiguration.cscfg with osVersion set to host os 1.1 -
<?xml version="1.0"?>
<ServiceConfiguration
serviceName="MyVHDWebRole"
osVersion="WA-GUEST-OS-1.1_201001-01"
xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
<Role name="MyVHD_WebRole">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="DiagnosticsConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="AzureStorageAccount" value="devstoreaccount1" />
<Setting name="AzureStorageKey" value="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" />
<Setting name="BlobStorageEndpoint" value="http://127.0.0.1:10000/devstoreaccount1/" />
<Setting name="QueueStorageEndpoint" value="http://127.0.0.1:10001/devstoreaccount1/" />
<Setting name="TableStorageEndpoint" value="http://127.0.0.1:10002/devstoreaccount1/" />
<Setting name="BlobContainePCLDrives" value="vhddrives" />
<Setting name="VHDDriveName" value="myvhddrive.vhd" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
Host 1.1 does not yet support .NET Framework 4.0 yet (in the cloud)
This sample uses the local development storage - not Azure Storage in the cloud
[more to come soon]






