<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://cicoria.com/cs1/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Shawn Cicoria - CedarLogic</title><link>http://cicoria.com/cs1/blogs/cedarlogic/default.aspx</link><description>Perspectives and Observations on Technology</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><item><title>Learn More about Microsoft Codename "Trust Services" - TechNet Articles - Home - TechNet Wiki</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2012/02/04/learn-more-about-microsoft-codename-quot-trust-services-quot-technet-articles-home-technet-wiki.aspx</link><pubDate>Sat, 04 Feb 2012 14:50:45 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2932</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2932</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2012/02/04/learn-more-about-microsoft-codename-quot-trust-services-quot-technet-articles-home-technet-wiki.aspx#comments</comments><description>&lt;p&gt;Many companies, ISV’s, and solutions have concerns about data in the cloud.&amp;#160; With PKI based encryption, Trust Services provides key management for your publisher/subscribers and a simplified SDK set of classes to abstract the encryption, decryption process.&amp;#160; Both managed classes and PowerShell add-in provided...&lt;/p&gt;  &lt;p&gt;&lt;a href="http://social.technet.microsoft.com/wiki/contents/articles/7041.learn-more-about-microsoft-codename-trust-services.aspx"&gt;Learn More about Microsoft Codename &amp;quot;Trust Services&amp;quot; - TechNet Articles - Home - TechNet Wiki&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2932" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Azure/default.aspx">Azure</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Security/default.aspx">Security</category></item><item><title>Making Windows Azure Drive Letter Persistent</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2012/01/19/making-windows-azure-drive-letter-persistent.aspx</link><pubDate>Thu, 19 Jan 2012 20:39:49 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2931</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2931</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2012/01/19/making-windows-azure-drive-letter-persistent.aspx#comments</comments><description>&lt;p&gt;Windows Azure Fieldnote&lt;/p&gt;  &lt;h3&gt;Summary&lt;/h3&gt;  &lt;p&gt;Windows Azure Drives [1] provide a means to represent a file based (disk drive) persistent storage option for the various role types within Windows Azure Compute. Each of the roles within Windows Azure can mount and utilize for persistent storage (that survives reboot, reimaging, and updated deployments, of a role instances). &lt;/p&gt;  &lt;p&gt;During the mounting of a VHD as a &lt;b&gt;CloudDrive&lt;/b&gt;, the managed classes have no means to control the drive letter assignment this directly through the &lt;b&gt;CloudDrive&lt;/b&gt; managed classes that are provided through the Windows Azure SDK.&lt;/p&gt;  &lt;h3&gt;Problem&lt;/h3&gt;  &lt;p&gt;Many solutions today require the use of standard Windows File IO based access and instead of refactoring solutions to leverage the storage options available in the PaaS part of the Windows Azure platform, solutions deployed to Windows Azure can mount a Virtual Hard Disk (VHD) that is persisted in a storage account inside of a running instance. That Page Blob backed VHD is then represented through Virtual Disk Services and Windows Cloud Drive services to the running instances as a Disk Drive and addressable through File IO using a Drive Letter.&lt;/p&gt;  &lt;p&gt;While a persistent drive option is available, the drive letter assignment is determined at runtime during the mounting process. This potentially presents a problem with existing solutions, codebases, libraries that require a setting to be established prior to runtime. For example, an application configuration setting that provides a full path, including the drive letter to a location for read/write access for File IO.&lt;/p&gt;  &lt;h3&gt;Solution&lt;/h3&gt;  &lt;p&gt;The following solution takes advantage of the Virtual Disk Services through the &lt;b&gt;DiskPart.exe&lt;/b&gt; operating system utility to first identify what the VHD is mounted as and, select that volume, and re-assign the letter to the target drive letter.&lt;/p&gt;  &lt;p&gt;The original idea for the approach comes from this blog post here: &lt;a href="http://techyfreak.blogspot.com/2011/02/changing-drive-letter-of-azure-drive.html"&gt;http://techyfreak.blogspot.com/2011/02/changing-drive-letter-of-azure-drive.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;While there is a COM interface available that could be wrapped via an interop layer, the choice was made to initiate a process to take the actions required for remapping the drive letter due to simplicity. Additionally, while there is an existing managed Interop assembly available (&lt;strong&gt;Microsoft.Storage.Vds&lt;/strong&gt;) that is an undocumented and unsupported assembly.&lt;/p&gt;  &lt;p&gt;The example scenario presented does the following:&lt;/p&gt;  &lt;p&gt;1. Leverages a Windows Azure Web Role (could be a Worker Role or VM Role as well)&lt;/p&gt;  &lt;p&gt;2. Implements a Windows Console applications that:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;a. Is a Startup task – in elevated mode and background&lt;/p&gt;    &lt;p&gt;b. Runs elevated in order to affect Virtual Disk Services&lt;/p&gt;    &lt;p&gt;c. At startup:&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;ul&gt;     &lt;li&gt;Mounts the VHD from Windows Azure Storage&lt;/li&gt;      &lt;li&gt;Detects if target drive letter and re-assigns as needed to target drive letter **&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;d. Then Continuously (every 30 seconds)&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;ul&gt;     &lt;li&gt;i. Checks if drive is mounted on target drive letter&lt;/li&gt;      &lt;li&gt;ii. If not, reassigns drive letter **&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;** Drive Letter reassignment is done through a &lt;i&gt;System.Process&lt;/i&gt; startup object that runs Diskpart.exe with a “select volume” and “assign drive letter” command sequence.&lt;/b&gt;&lt;/p&gt;  &lt;h3&gt;Implementation&lt;/h3&gt;  &lt;p&gt;The sample solution contains the following:&lt;/p&gt;  &lt;p&gt;1. Windows Azure Web Role – simple MVC3 application that just lists the mapped &lt;b&gt;CloudDrives&lt;/b&gt; using the &lt;b&gt;CloudDrive.GetMountedDrives()&lt;/b&gt; method&lt;/p&gt;  &lt;p&gt;2. &lt;b&gt;CloudDriveManager&lt;/b&gt; class library – helper class that provides the CloudDrive management actions leveraged by the caller (either Console or other code)&lt;/p&gt;  &lt;p&gt;3. &lt;b&gt;CloudDriveManagerConsole&lt;/b&gt; – Windows console application intended to be a startup project and running in elevated mode in order to affect the assigned driver letter&lt;/p&gt;  &lt;p&gt;4. &lt;b&gt;CloudDriveManagerRole&lt;/b&gt; – implementation of &lt;b&gt;Microsoft.WindowsAzure.ServiceRuntime.RoleEntryPoint&lt;/b&gt; – which allows this class to be used from within a Windows Azure Web or Worker role – however, that role entry point would need to be elevated (via the “&lt;b&gt;Runtime&lt;/b&gt;” and “&lt;b&gt;NetFxEntryPoint&lt;/b&gt;” Elements)&lt;/p&gt;  &lt;p&gt;5. &lt;b&gt;Logger&lt;/b&gt; – simple logger class that writes to a Queue for debugging purposes&lt;/p&gt;  &lt;p&gt;6. &lt;b&gt;ResponseViewer&lt;/b&gt; – simple WPF application that reads Queue messages so you can view log messages from your cloud instances – purely for debugging purposes&lt;/p&gt;  &lt;p&gt;7. &lt;b&gt;TestListDrives&lt;/b&gt; – simple Windows console application that lists the mapped &lt;b&gt;CloudDrives&lt;/b&gt; – usable from within the Role instance by using Remote Desktop and connecting to the instance&lt;/p&gt;  &lt;h4&gt;Instance Initialization&lt;/h4&gt;  &lt;p&gt;During role startup, Windows Azure will execute the Task defined in the Service definition in background mode and elevated (running as system). Inside of the console application, the implementation of &lt;b&gt;OnStart&lt;/b&gt; does the following:&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;public override bool OnStart()
{
    try
    {
        Initialize();
        MountAllDrives();
    }
    catch (Exception ex)
    {
        _logger.Log(&amp;quot;fail on onstart&amp;quot;, ex);
    }
    return true;
}

void MountAllDrives()
{
    try
    {
        var driveSettings = RoleEnvironment.GetConfigurationSettingValue(DRIVE_SETTINGS);
        string[] settings = driveSettings.Split(&amp;#39;:&amp;#39;);
        CloudStorageAccount account =CoudStorageAccount.FromConfigurationSetting(STORAGE_ACCOUNT_SETTING);
        string dCacheName = RoleEnvironment.GetConfigurationSettingValue(DCACHE_NAME);
        LocalResource cache = RoleEnvironment.GetLocalResource(dCacheName);
        int cacheSize = cache.MaximumSizeInMegabytes / 2;
        _cloudDriveManager = new CloudDriveManager(account, settings[0], settings[1][0], cache);
        _cloudDriveManager.CreateDrive();
        _cloudDriveManager.Mount();
    }
    catch (Exception ex)
    {
        _logger.Log(&amp;quot;fail on mountalldrives&amp;quot;, ex);
        throw;
    }
}&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Mostly, the startup routine calls into the custom class &lt;b&gt;CloudDriveManager&lt;/b&gt;, which provides the simple abstraction to the Windows Azure &lt;b&gt;CloudDrive&lt;/b&gt; managed class.&lt;/p&gt;

&lt;p&gt;The custom &lt;b&gt;CreateDrive&lt;/b&gt; method calls the &lt;b&gt;CloudDrive&lt;/b&gt; create drive method in a non-destructive manner – and, for this sample, creates the initial VHD in storage if it does not already exist.&lt;/p&gt;

&lt;p&gt;Mounting calls the managed classes &lt;b&gt;CloudDrive.Moun&lt;/b&gt;t along with calling into a custom &lt;b&gt;VerifyDriveLetter&lt;/b&gt; method.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;public void Mount()
{
    _logger.Log(string.Format(&amp;quot;mounting drive {0}&amp;quot;, _vhdName));
    _cloudDrive = _account.CreateCloudDrive(_vhdName);

    var driveLetter = _cloudDrive.Mount(_cacheSize, DriveMountOptions.Force);
    _logger.Log(string.Format(&amp;quot;mounted drive letter {0}&amp;quot;, driveLetter));

    var remounted = VerifyDriveLetter();
}&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Within &lt;b&gt;VerifyDriveLetter&lt;/b&gt; there’s some logic to validate the current state of the mounted drives. And then verification if the mounted drive is the intended drive letter.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;public bool VerifyDriveLetter()
{
    _logger.Log(&amp;quot;verifying drive letter&amp;quot;);
    bool rv = false;
    if (RoleEnvironment.IsEmulated)
    {
        _logger.Log(&amp;quot;Can&amp;#39;t change drive letter in emulator&amp;quot;);
        //return;
    }

    try
    {
        DriveInfo d = new DriveInfo(_cloudDrive.LocalPath);
        if (string.IsNullOrEmpty(_cloudDrive.LocalPath))
        {
            _logger.Log(&amp;quot;verifydriveLetter: Not Mounted?&amp;quot;);
            throw new InvalidOperationException(&amp;quot;drive is notmounted&amp;quot;);
        }

        if (!char.IsLetter(_cloudDrive.LocalPath[0]))
        {
            _logger.Log(&amp;quot;verifiydriveLeter: Not a letter?&amp;quot;);
            throw new InvalidOperationException(&amp;quot;verifydriveletter - not a letter?&amp;quot;);
        }

        if (IsSameDrive())
        {
            _logger.Log(&amp;quot;is same drive; no need to diskpart...&amp;quot;);
            return true;
        }

        char mountedDriveLetter = CurrentLocalDrive(_vhdName);
        RunDiskPart(_driveLetter, mountedDriveLetter);

        if (!IsSameDrive())
        {
            var msg = &amp;quot;Drive change failed to change&amp;quot;;
                   _logger.Log(msg);
                   throw new ApplicationException(msg);
               }
               else
               {
                   Mount();
               }

               _logger.Log(&amp;quot;verifydriveletter done!!&amp;quot;);
               return rv;

           }
           catch (Exception ex)
           {
               _logger.Log(&amp;quot;error verifydriveletter&amp;quot;, ex);
               return rv;
           }

       }&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The &lt;b&gt;IsSameDrive&lt;/b&gt; method validates if the current mapped drive is indeed the planned drive letter. If not, it will return “false”.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;bool IsSameDrive()
{
    char targetDrive = _driveLetter.ToString().ToLower()[0];
    char currentDrive = CurrentLocalDrive(_vhdName);

    string msg = string.Format(
        &amp;quot;target drive: {0} - current drive: {1}&amp;quot;,
        targetDrive,
        currentDrive);

    _logger.Log(msg);

    if (targetDrive == currentDrive)
    {
        _logger.Log(&amp;quot;verifydriveLetter: already same drive&amp;quot;);
        return true;
    }
    else
        return false;

}&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Finally, the &lt;b&gt;RunDiskPart&lt;/b&gt; method initiates the action of spawning a new process with the dynamically created &lt;b&gt;DiskPart&lt;/b&gt; script file that selects the existing volume name (by drive letter) and assigns the target drive letter.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;void RunDiskPart(char destinationDriveLetter, char mountedDriveLetter)
{
    string diskpartFile = Path.Combine(_cache.RootPath, &amp;quot;diskpart.txt&amp;quot;);

    if (File.Exists(diskpartFile))
    {
        File.Delete(diskpartFile);
    }

    string cmd = &amp;quot;select volume = &amp;quot; + mountedDriveLetter + &amp;quot;\r\n&amp;quot; + &amp;quot;assign letter = &amp;quot; + destinationDriveLetter;
      File.WriteAllText(diskpartFile, cmd);

      //start the process
      _logger.Log(&amp;quot;running diskpart now!!!!&amp;quot;);
      _logger.Log(&amp;quot;using &amp;quot; + cmd);
      using (Process changeletter = new Process())
      {
          changeletter.StartInfo.Arguments = &amp;quot;/s&amp;quot; + &amp;quot; &amp;quot; + diskpartFile;
          changeletter.StartInfo.FileName = 
     System.Environment.GetEnvironmentVariable(&amp;quot;WINDIR&amp;quot;) + &amp;quot;\\System32\\diskpart.exe&amp;quot;;
        //#if !DEBUG
        changeletter.Start();
        changeletter.WaitForExit();
        //#endif
    }

    File.Delete(diskpartFile);

}&lt;/pre&gt;

&lt;h3&gt;Output and Results&lt;/h3&gt;

&lt;p&gt;As an example of the interaction and how the drive appears within the running Windows Azure Role, the following screen shots illustrate the results.&lt;/p&gt;

&lt;h4&gt;Program Startup&lt;/h4&gt;

&lt;p&gt;At program startup the drive is initially mounted by the Console application – immediately the drive is mounted as the F: drive – the startup code verifies if this is the intended drive – as shown below in the logs, it isn’t, so the code initiates the RunDiskPart method setting M: as the mapped drive.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_0A5030DA.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_33E3FC0D.png" width="574" height="408" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The following shows how a Windows Azure Drive appears after the custom code reassigns the drive letter to the Operating system using Windows Explorer – the drive is selected below.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_12845671.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_58951384.png" width="576" height="344" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Within the custom MVC3 application, which simply just lists the Mounted Windows Azure drive (which runs in a separate Process non-elevated – the drive appears as a regular Operating System drive – accessible for File IO as required using the intended drive letter.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_09B44E25.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_68C0DB7D.png" width="572" height="269" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;Forced Letter Change&lt;/h4&gt;

&lt;p&gt;The following shows what happens if the drive letter is intentionally changed – in this example, I just initiate a &lt;b&gt;DiskPart&lt;/b&gt; set of commands to assign the mounted drive the letter L:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_2ED19891.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_0DDE25EA.png" width="575" height="347" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see in the Windows Explorer window the letter now appears as L: for the &lt;b&gt;WindowsAzureDrive&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;Within approximately 30 seconds (which is the value used in the &lt;b&gt;Run&lt;/b&gt; method by the custom code) &lt;b&gt;VerifyDriveLetter&lt;/b&gt; detects it’s not the intended drive and initiates a change.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_1AD805FB.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_328F3D61.png" width="584" height="357" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;And the below image shows the drive again, appearing as the M: drive:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_6342450C.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_424ED265.png" width="615" height="371" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Future Options&lt;/h3&gt;

&lt;p&gt;Since capabilities in the Windows Azure platform change over time the ability to dictate the specific letter to be used may come available. Until then, this approach, by means of the Windows Azure Drive and Virtual Disk Services abstraction provided by the platform offers a means to accommodate codebase and application logic that is dependent upon predetermined drive letters.&lt;/p&gt;

&lt;h3&gt;References&lt;/h3&gt;

&lt;p&gt;[1] Windows Azure Drives &lt;a href="http://www.windowsazure.com/en-us/develop/net/fundamentals/cloud-storage/#drives"&gt;http://www.windowsazure.com/en-us/develop/net/fundamentals/cloud-storage/#drives&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[2] Virtual Disk Service &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/bb986750(v=vs.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/windows/desktop/bb986750(v=vs.85).aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[3] CloudDrive Storage Client &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storageclient.clouddrive.aspx"&gt;http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storageclient.clouddrive.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[4] Diskpart.exe &lt;a href="http://technet.microsoft.com/en-us/library/cc770877(v=WS.10).aspx"&gt;http://technet.microsoft.com/en-us/library/cc770877(v=WS.10).aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[5] Task element &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/gg557552.aspx#Task"&gt;http://msdn.microsoft.com/en-us/library/windowsazure/gg557552.aspx#Task&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="http://cicoria.com/cs1/emoticons/emotion-14.gif" alt="Devil" /&gt; Runtime element &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/gg557552.aspx#Runtime"&gt;http://msdn.microsoft.com/en-us/library/windowsazure/gg557552.aspx#Runtime&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[7] NetFxEntryPoint element &lt;a href="http://msdn.microsoft.com/en-us/library/windowsazure/gg557552.aspx#NetFxEntryPoint"&gt;http://msdn.microsoft.com/en-us/library/windowsazure/gg557552.aspx#NetFxEntryPoint&lt;/a&gt;&lt;/p&gt;











&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a title="http://cicoria.com/downloads/waz/MountXDriveSameLetter.zip" href="http://cicoria.com/downloads/waz/MountXDriveSameLetter.zip"&gt;Solution File: MountXDriveSameLetter.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2931" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Utilities/default.aspx">Utilities</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Cloud/default.aspx">Cloud</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Windows+Azure/default.aspx">Windows Azure</category></item><item><title>Viewing the User Token from Visual Studio 2010 Debugger</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/12/06/viewing-the-user-token-from-visual-studio-2010-debugger.aspx</link><pubDate>Tue, 06 Dec 2011 23:00:58 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2930</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2930</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/12/06/viewing-the-user-token-from-visual-studio-2010-debugger.aspx#comments</comments><description>&lt;p&gt;When you’re debugging security related things, sometimes you need to take a look at the thread identities user token.&lt;/p&gt;  &lt;p&gt;When you’re inside of Visual Studio 2010 – in the watch windows you enter ‘$user’&amp;#160; and you’ll get the same as when in windbg with !token –n&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/SNAGHTML6af2ad9_5F00_1D040A08.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="SNAGHTML6af2ad9" border="0" alt="SNAGHTML6af2ad9" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/SNAGHTML6af2ad9_5F00_thumb_5F00_150C67A6.png" width="682" height="219" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2930" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/.NET/default.aspx">.NET</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Tricks/default.aspx">Tricks</category></item><item><title>Microsoft TechNet–Create PDF Takeaway chapters for your set of topics–great feature just added..</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/11/30/microsoft-technet-create-pdf-takeaway-chapters-for-your-set-of-topics-great-feature-just-added.aspx</link><pubDate>Wed, 30 Nov 2011 15:25:14 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2929</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2929</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/11/30/microsoft-technet-create-pdf-takeaway-chapters-for-your-set-of-topics-great-feature-just-added.aspx#comments</comments><description>&lt;p&gt;If you’re like me, having those PDF version for offline review are great.&amp;#160; It was a pain before as I had to individually print web pages to single PDF using tools.&lt;/p&gt;  &lt;p&gt;Now, TechNet can track a “book” of topics for you, and then generate HTML or PDF for you to download – personal publishing &lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://cicoria.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/wlEmoticon_2D00_smile_5F00_1796848C.png" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/b/tonyso/archive/2011/09/13/roll-your-own-techdocs.aspx"&gt;Roll-your-own techdocs for free - TONYSO - Site Home - TechNet Blogs&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2929" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Tricks/default.aspx">Tricks</category></item><item><title>Dennis Ritchie, Father of C and Co-Developer of Unix, Dies | Wired Enterprise | Wired.com</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/10/14/dennis-ritchie-father-of-c-and-co-developer-of-unix-dies-wired-enterprise-wired-com.aspx</link><pubDate>Fri, 14 Oct 2011 14:43:19 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2928</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2928</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/10/14/dennis-ritchie-father-of-c-and-co-developer-of-unix-dies-wired-enterprise-wired-com.aspx#comments</comments><description>&lt;p&gt;Wow – I still have my &lt;a href="http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628/ref=sr_1_1?ie=UTF8&amp;amp;qid=1318603382&amp;amp;sr=8-1" target="_blank"&gt;K&amp;amp;R book&lt;/a&gt; from a class I took at AT&amp;amp;T.&amp;#160; Cut my teeth on nix…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.wired.com/wiredenterprise/2011/10/dennis-ritchie/"&gt;Dennis Ritchie, Father of C and Co-Developer of Unix, Dies | Wired Enterprise | Wired.com&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2928" width="1" height="1"&gt;</description></item><item><title>Description of Update Rollup 1 for Active Directory Federation Services (AD FS) 2.0</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/10/13/description-of-update-rollup-1-for-active-directory-federation-services-ad-fs-2-0.aspx</link><pubDate>Thu, 13 Oct 2011 12:57:07 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2927</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2927</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/10/13/description-of-update-rollup-1-for-active-directory-federation-services-ad-fs-2-0.aspx#comments</comments><description>&lt;p&gt;Multiple UPN support now available…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://support.microsoft.com/kb/2607496"&gt;Description of Update Rollup 1 for Active Directory Federation Services (AD FS) 2.0&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2927" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Security/default.aspx">Security</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/ADFS/default.aspx">ADFS</category></item><item><title>Additional Mime Types in Visual Studio 2010 Development Web Server</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/10/06/additional-mime-types-in-visual-studio-2010-development-web-server.aspx</link><pubDate>Thu, 06 Oct 2011 22:38:51 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2926</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2926</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/10/06/additional-mime-types-in-visual-studio-2010-development-web-server.aspx#comments</comments><description>&lt;p&gt;While the development server in Visual Studio 2010 is great for most work, it does have 1 shortcoming in that if you start adding content types that are not part of the base set of known Mime types built in, you won’t affect the proper header response that is emitted to the client/browser.&lt;/p&gt;  &lt;p&gt;For example MP4 files, out of the box the development web server emits application/octet-stream or something like that.&amp;#160; What we really need is video/mp4.&lt;/p&gt;  &lt;p&gt;Now, with IIS Express, you can easily switch over to use that and just add the correct mapping to the section of the web.config when you’re running in integrated mode.&amp;#160; Such as follows:&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;system.webServer&amp;gt;
  &amp;lt;modules runAllManagedModulesForAllRequests=&amp;quot;true&amp;quot; /&amp;gt;
  &amp;lt;staticContent&amp;gt;
    &amp;lt;mimeMap fileExtension=&amp;quot;.mp4&amp;quot; mimeType=&amp;quot;video/mp4&amp;quot; /&amp;gt;
    &amp;lt;mimeMap fileExtension=&amp;quot;.m4v&amp;quot; mimeType=&amp;quot;video/m4v&amp;quot; /&amp;gt;
  &amp;lt;/staticContent&amp;gt;
&amp;lt;/system.webServer&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;However, with the Visual Studio 2010 built in Web Development server, you can’t affect the mime type support through configuration. &lt;/p&gt;

&lt;p&gt;For this a simple NuGet package is available that provides a simple HttpModule to affect the ContentType on the response headers.&amp;#160; it reads the Web.config for the site and will honor the section above – this all happens only when NOT running in Integrated Pipeline mode.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_3C0A4A4C.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_7448C164.png" width="418" height="49" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/SNAGHTML6f59550_5F00_6C511F02.png"&gt;&lt;img style="background-image:none;border-bottom:0px;border-left:0px;padding-left:0px;padding-right:0px;display:inline;border-top:0px;border-right:0px;padding-top:0px;" title="SNAGHTML6f59550" border="0" alt="SNAGHTML6f59550" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/SNAGHTML6f59550_5F00_thumb_5F00_5D3A4028.png" width="548" height="274" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sample Solution and Source here: &lt;a href="http://cicoria.com/downloads/SampleMimeHelper.zip"&gt;SampleMimeHelper.zip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The HttpModule makes use of dynamically loading via the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.preapplicationstartmethodattribute.aspx" target="_blank"&gt;PreApplicationStartMethod&lt;/a&gt; and the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.web.infrastructure.dynamicmodulehelper.dynamicmoduleutility.registermodule.aspx" target="_blank"&gt;DynamicModuleHelper&lt;/a&gt; utility method that is part of the Microsoft.Web.Infrastructure namespace. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Diagnostics;
using System.Configuration;
using System.Web.Configuration;
using System.Xml.Linq;
using Microsoft.Web.Infrastructure.DynamicModuleHelper;

[assembly: PreApplicationStartMethod(typeof(MimeHelper), &amp;quot;Start&amp;quot;)]

/// &amp;lt;summary&amp;gt;
/// Summary description for MimeHelper
/// &amp;lt;/summary&amp;gt;
public class MimeHelper : IHttpModule
{
    static Dictionary&amp;lt;string, string&amp;gt; s_mimeMappings;
    static object s_lockObject = new object();

    public static void Start()
    {
        if ( ! HttpRuntime.UsingIntegratedPipeline)
            DynamicModuleUtility.RegisterModule(typeof(MimeHelper));
    }

    static string GetMimeType(HttpContext context)
    {
        var ext = VirtualPathUtility.GetExtension(context.Request.Url.ToString());
        if (string.IsNullOrEmpty(ext)) return null;

        CreateMapping(context.ApplicationInstance);

        string mimeType = null;
        s_mimeMappings.TryGetValue(ext, out mimeType);

        return mimeType;

    }

    static void CreateMapping(HttpApplication app)
    {
        if (null == s_mimeMappings)
        {
            lock (s_lockObject)
            {
                if (null == s_mimeMappings)
                {
                    string path = app.Server.MapPath(&amp;quot;~/web.config&amp;quot;);
                    XDocument doc = XDocument.Load(path);

                    var s = from v in doc.Descendants(&amp;quot;system.webServer&amp;quot;).Descendants(&amp;quot;staticContent&amp;quot;).Descendants(&amp;quot;mimeMap&amp;quot;)
                            select new { mimeType = v.Attribute(&amp;quot;mimeType&amp;quot;).Value, fileExt = v.Attribute(&amp;quot;fileExtension&amp;quot;).Value };

                    s_mimeMappings = new Dictionary&amp;lt;string, string&amp;gt;();
                    foreach (var item in s)
                    {
                        s_mimeMappings.Add(item.fileExt.ToString(), item.mimeType.ToString());
                    }
                }
            }
        }
    }


    public void Dispose() { }

    public void Init(HttpApplication context)
    {
        context.EndRequest += new EventHandler(context_EndRequest);
    }

    void context_EndRequest(object sender, EventArgs e)
    {
        try
        {
            HttpApplication app = sender as HttpApplication;
            string mimeType = GetMimeType(app.Context);

            if (null == mimeType) return;

            app.Context.Response.ContentType = mimeType;
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex.Message);
        }
    }
}&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2926" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/.NET/default.aspx">.NET</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Code/default.aspx">Code</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/VS2010/default.aspx">VS2010</category></item><item><title>Faking SPContext–for testing only…</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/21/faking-spcontext-for-testing-only.aspx</link><pubDate>Wed, 21 Sep 2011 21:54:41 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2925</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2925</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/21/faking-spcontext-for-testing-only.aspx#comments</comments><description>&lt;p&gt;Keith Dahlby has a good post on creating a fake SPContext.&amp;#160; Here’s the link and the code&lt;/p&gt;  &lt;p&gt;NOTE: This is not production safe code – use at own risk…&lt;/p&gt;  &lt;p&gt;&lt;a title="http://solutionizing.net/2009/02/16/faking-spcontext/" href="http://solutionizing.net/2009/02/16/faking-spcontext/"&gt;http://solutionizing.net/2009/02/16/faking-spcontext/&lt;/a&gt;&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;public static SPContext FakeSPContext(SPWeb contextWeb)
{
  // Ensure HttpContext.Current
  if (HttpContext.Current == null)
  {
    HttpRequest request = new HttpRequest(&amp;quot;&amp;quot;, web.Url, &amp;quot;&amp;quot;);
    HttpContext.Current = new HttpContext(request,
      new HttpResponse(TextWriter.Null));
  }

  // SPContext is based on SPControl.GetContextWeb(), which looks here
  if(HttpContext.Current.Items[&amp;quot;HttpHandlerSPWeb&amp;quot;] == null)
    HttpContext.Current.Items[&amp;quot;HttpHandlerSPWeb&amp;quot;] = web;

  return SPContext.Current;
}&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2925" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>Use an Action delegate to time a method…</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/21/use-an-action-delegate-to-time-a-method.aspx</link><pubDate>Wed, 21 Sep 2011 19:15:03 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2924</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2924</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/21/use-an-action-delegate-to-time-a-method.aspx#comments</comments><description>&lt;p&gt;I wanted an ability to be able to simply time methods and write to a log/trace sink and a very simple approach that I ended up using was to provide a method that takes an Action delegate which would be the method that is to be timed.&lt;/p&gt;  &lt;p&gt;The following is what I came up with (this is my reminder…)&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;class Program
{
    static void Main(string[] args)
    {
        TestMethod1();
    }

    private static void TestMethod1()
    {
        LoggingHelper.TimeThis(&amp;quot;doing something&amp;quot;, () =&amp;gt;
        {
            Console.WriteLine(&amp;quot;This is the Real Method Body&amp;quot;);
            Thread.Sleep(100);
        });
    }
}

public static class LoggingHelper
{
    public static void TimeThis(string message, Action action)
    {
        string methodUnderTimer = GetMethodCalled(1);
        Stopwatch sw = Stopwatch.StartNew();
        LogMessage( string.Format(&amp;quot;started: {0} : {1}&amp;quot;, methodUnderTimer, message));
        action();
        sw.Stop();
        LogMessage(string.Format(&amp;quot;ended  : {0} : {1} : elapsed : {2}&amp;quot;, methodUnderTimer, message, sw.Elapsed));

    }

    private static string GetMethodCalled(int stackLevel)
    {
        StackTrace stackTrace = new StackTrace();
        StackFrame stackFrame = stackTrace.GetFrame(stackLevel + 1);
        MethodBase methodBase = stackFrame.GetMethod();
        return methodBase.Name;
    }

    static void LogMessage(string message){
        Console.WriteLine(&amp;quot;{0}&amp;quot;, message);
    }

}&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2924" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/.NET/default.aspx">.NET</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Code/default.aspx">Code</category></item><item><title>Comparison of Windows Azure Storage Queues and Service Bus Queues « Microsoft Technologies Rocks !!!</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/20/comparison-of-windows-azure-storage-queues-and-service-bus-queues-171-microsoft-technologies-rocks.aspx</link><pubDate>Tue, 20 Sep 2011 12:06:46 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2923</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2923</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/20/comparison-of-windows-azure-storage-queues-and-service-bus-queues-171-microsoft-technologies-rocks.aspx#comments</comments><description>&lt;p&gt;Nice table comparing Windows Azure Queues vs. Windows Azure AppFabric Service Bus – note the comment regarding in WAZ SDK 1.5 Queue message size is now 64KB&lt;/p&gt;  &lt;p&gt;Of course, I like the name of the blog too.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://preps2.wordpress.com/2011/09/17/comparison-of-windows-azure-storage-queues-and-service-bus-queues/"&gt;Comparison of Windows Azure Storage Queues and Service Bus Queues « Microsoft Technologies Rocks !!!&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2923" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Azure/default.aspx">Azure</category></item><item><title>MiniProfiler– A simple but effective mini-profiler for ASP.NET MVC and ASP.NET.</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/18/miniprofiler-a-simple-but-effective-mini-profiler-for-asp-net-mvc-and-asp-net.aspx</link><pubDate>Sun, 18 Sep 2011 13:34:49 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2922</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2922</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/18/miniprofiler-a-simple-but-effective-mini-profiler-for-asp-net-mvc-and-asp-net.aspx#comments</comments><description>&lt;p&gt;Once in a while a good tool that I find out about that helps me developing solutions comes in real handy.&amp;#160; MiniProfiler is one of those tools.&lt;/p&gt;  &lt;p&gt;Developed by the StackOverflow folks it’s available in source or binary, and NuGet packages&lt;/p&gt;  &lt;p&gt;Take a look&lt;/p&gt;  &lt;p&gt;&lt;a title="http://code.google.com/p/mvc-mini-profiler/" href="http://code.google.com/p/mvc-mini-profiler/"&gt;http://code.google.com/p/mvc-mini-profiler/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a title="http://nuget.org/List/Packages/MiniProfiler" href="http://nuget.org/List/Packages/MiniProfiler"&gt;http://nuget.org/List/Packages/MiniProfiler&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2922" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/.NET/default.aspx">.NET</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Utilities/default.aspx">Utilities</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/MVC/default.aspx">MVC</category></item><item><title>Slides for BUILD conference…</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/18/slides-for-build-conference.aspx</link><pubDate>Sun, 18 Sep 2011 12:44:56 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2921</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2921</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/18/slides-for-build-conference.aspx#comments</comments><description>&lt;p&gt;On the Channel 9 site where the BUILD conference sessions are available, there are several feeds that provide the media associated with the sessions.&lt;/p&gt;  &lt;p&gt;One that’s not listed explicitly is the PowerPoint slides – that feed is here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://channel9.msdn.com/Events/BUILD/BUILD2011/RSS/slides" href="http://channel9.msdn.com/Events/BUILD/BUILD2011/RSS/slides"&gt;http://channel9.msdn.com/Events/BUILD/BUILD2011/RSS/slides&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2921" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Build/default.aspx">Build</category></item><item><title>Building scalable web applications with Windows Azure (ed. and on premise too!)</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/17/building-scalable-web-applications-with-windows-azure-ed-and-on-premise-too.aspx</link><pubDate>Sat, 17 Sep 2011 16:24:25 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2920</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2920</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/17/building-scalable-web-applications-with-windows-azure-ed-and-on-premise-too.aspx#comments</comments><description>&lt;p&gt;Matthew Kerner’s session at BUILD covers many of the patterns and approaches that a well designed and highly scalable solution can do to make the most efficient use of the platform.&lt;/p&gt;  &lt;p&gt;Truth is many of the areas Matthew covers should be for on Premise too – including use of Windows Azure CDN...&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;img style="border-bottom-style:none;border-left-style:none;border-top-style:none;border-right-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/wlEmoticon_2D00_smile_5F00_45B0C56D.png" /&gt;&amp;#160; At about ~30:00 in Matthew references one of my posts on Windows Azure CDN and using it with your Compute role (hosted service) as an CDN origin…&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Building scalable web apps with Windows Azure   &lt;br /&gt;&lt;a title="http://channel9.msdn.com/events/BUILD/BUILD2011/SAC-870T" href="http://channel9.msdn.com/events/BUILD/BUILD2011/SAC-870T"&gt;http://channel9.msdn.com/events/BUILD/BUILD2011/SAC-870T&lt;/a&gt;&lt;/p&gt; &lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2920" width="1" height="1"&gt;</description></item><item><title>Bringing Hyper-V to “Windows 8” - Building Windows 8 - Site Home - MSDN Blogs</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/07/bringing-hyper-v-to-windows-8-building-windows-8-site-home-msdn-blogs.aspx</link><pubDate>Wed, 07 Sep 2011 21:27:15 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2917</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2917</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/09/07/bringing-hyper-v-to-windows-8-building-windows-8-site-home-msdn-blogs.aspx#comments</comments><description>&lt;p&gt;This is huge – and a welcomed addition.&amp;#160; Been waiting too long for this.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/b/b8/archive/2011/09/07/bringing-hyper-v-to-windows-8.aspx"&gt;Bringing Hyper-V to “Windows 8” - Building Windows 8 - Site Home - MSDN Blogs&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2917" width="1" height="1"&gt;</description></item><item><title>Hosted Service as a Windows Azure CDN Origin Tips</title><link>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/07/10/hosted-service-as-a-windows-azure-cdn-origin-tips.aspx</link><pubDate>Sun, 10 Jul 2011 17:27:30 GMT</pubDate><guid isPermaLink="false">29a00c46-c030-43c5-bbda-4d08b2dd4d56:2916</guid><dc:creator>cicorias</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://cicoria.com/cs1/blogs/cedarlogic/rsscomments.aspx?PostID=2916</wfw:commentRss><comments>http://cicoria.com/cs1/blogs/cedarlogic/archive/2011/07/10/hosted-service-as-a-windows-azure-cdn-origin-tips.aspx#comments</comments><description>&lt;p&gt;The Windows Azure Content Delivery Network (CDN) helps improve the solution experience by putting content closer to the end-user, enhances availability, geo-distribution, scalability, lower latency delivery, and performance. If that’s the goal we want to be sure that when we instantiate the source of this content at the origin it’s as CDN friendly as we need.&lt;/p&gt;  &lt;p&gt;In Windows Azure, when you’re running under IIS7.x /ASP.NET you have to be aware of the inherent behavior associated with Output Caching as it is part of the standard deployment of IIS7.x.&lt;/p&gt;  &lt;p&gt;Some of that inherent behavior affects how cache-friendly your content (Http Response) will be as the CDN directly consumes your Hosted Service endpoint ( http&lt;img src="http://cicoria.com/cs1/emoticons/emotion-56.gif" alt="Sleep" /&gt;://yourservice:80|443/cdn ) on behalf of your users.&lt;/p&gt;  &lt;p&gt;If you don’t understand how your solution emits these HTTP headers, you will end up with NO caching – defeating the purpose of the CDN (in fact making performance worse) and additional costs incurred.&lt;/p&gt;  &lt;p&gt;The areas we’ll briefly take a look at here are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Working with the ASP.NET OutputCache module for CDN Friendly HTTP Headers &lt;/li&gt;    &lt;li&gt;Vary:* Headers &lt;/li&gt;    &lt;li&gt;Compressed content with the CDN &lt;/li&gt;    &lt;li&gt;Use of IIS Virtual Application / Directories under Windows Azure &lt;/li&gt;    &lt;li&gt;Provide your own OutputCache module implementation &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Working with the ASP.NET OutputCache Module&lt;/h2&gt;  &lt;h3&gt;Default behavior&lt;/h3&gt;  &lt;p&gt;The following code is an example of what developers generally provided with anticipation that the HTTP headers, specifically the Cache-control header will be emitted with a CDN friendly HTTP header – or any cache for that matter.&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;using (var image = ImageUtil.RenderImage(…))
 {
     context.Response.Cache.SetMaxAge(TimeSpan.FromMinutes(Constants.MA));
     context.Response.Cache.SetCacheability(HttpCacheability.Public);
     context.Response.ContentType = &amp;quot;image/jpeg&amp;quot;;
     image.Save(context.Response.OutputStream, ImageFormat.Jpeg);
     context.Response.OutputStream.Flush();
 }&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Under ASP.NET 3.5/4.x, this will result in the following &lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_15CD6B3E.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_7B8D0219.png" width="359" height="198" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre class="brush: plain;"&gt;---request begin---
GET /image/0.jpg HTTP/1.0
User-Agent: Wget/1.11.4
Accept: */*
Host: az30993.vo.msecnd.net
Connection: Keep-Alive
---response begin---
HTTP/1.0 200 OK
Cache-Control: public
Content-Type: image/jpeg
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 08 Jul 2011 11:26:01 GMT
Content-Length: 6976
X-Cache: MISS from cds168.ewr9.msecn.net
Connection: keep-alive&lt;/pre&gt;

&lt;p&gt;With that set of headers, you will encounter a cache MISS on every request – with a read-through to the Hosted Service origin. You might not notice the impact right away as it can get picked up by the OutputCache module – but you’ve defeated the purpose of the CDN – and made the request performance worse.&lt;/p&gt;

&lt;p&gt;The sample solution with this post provides a set of test scenarios for manipulating the HttpResponse under a standard IHttpHandler and under MVC3. If you take a look at the code you’ll see that 3 things are done to help diagnose the situation.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Request Logger – this is a simple request logger that captures requests for the purposes of providing a simple view against the incoming requests (could have used IIS logs, but this is a simple way to get the requests I’m interested in and display them) &lt;/li&gt;

  &lt;li&gt;Kernel caching is disabled via the web.config – with this enabled requests won’t make it into your ASP.NET pipeline when it’s a cache hit – giving you a false positive on understanding if and when CDN requests are “leaking” through and not being cached at the CDN &lt;/li&gt;

  &lt;li&gt;OOB OutputCache module is removed, then re-added – this ensures it’s lower in the module list at request time allowing the Request Logger to be higher up in the call chain so I’m sure to capture the inbound requests – if they’re cached or not in the OutputCache module &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h5&gt;Set SlidingExpiration on Response&lt;/h5&gt;

&lt;p&gt;The easiest fix is to ensure you set SlidingExpiration to true on the response. This will ensure that the Cache-control header will contain your desired “public, max-age=xxxx”&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;public void ProcessRequest(HttpContext context)
{
    using (var image = ImageUtil.RenderImage(…)
    {
       context.Response.Cache.SetCacheability(HttpCacheability.Public);
       context.Response.Cache.SetMaxAge(TimeSpan.FromMinutes(Config.MaxAge));
       context.Response.ContentType = &amp;quot;image/jpeg&amp;quot;;
       context.Response.Cache.SetSlidingExpiration(true);
       image.Save(context.Response.OutputStream, ImageFormat.Jpeg);
    }
}&lt;/pre&gt;

&lt;h5&gt;Set an explicit Expires on the Response&lt;/h5&gt;

&lt;pre class="brush: csharp;"&gt;public void ProcessRequest(HttpContext context)
{
    using (var image = ImageUtil.RenderImage(…)
    {
      context.Response.Cache.SetCacheability(HttpCacheability.Public);
      context.Response.Cache.SetExpires(DateTime.Now.AddMinutes(Config.MA));
      context.Response.ContentType = &amp;quot;image/jpeg&amp;quot;;
      image.Save(context.Response.OutputStream, ImageFormat.Jpeg);
      context.Response.OutputStream.Flush();
    }
}&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h5&gt;Use Downstream as the location when using the MVC OutputCache Attribute&lt;/h5&gt;

&lt;pre class="brush: csharp;"&gt;[OutputCache(CacheProfile = &amp;quot;CacheDownstream&amp;quot;)]
public ActionResult Image3()
{
    MemoryStream oStream = new MemoryStream();
    using (Bitmap obmp = ImageUtil.RenderImage(…)
    {
       obmp.Save(oStream, ImageFormat.Jpeg);
       oStream.Position = 0;
       return new FileStreamResult(oStream, &amp;quot;image/jpeg&amp;quot;);
    }
}

//web.config
 &amp;lt;caching&amp;gt;
      &amp;lt;outputCacheSettings&amp;gt;
        &amp;lt;outputCacheProfiles&amp;gt;
          &amp;lt;add name=&amp;quot;CacheDownstream&amp;quot; 
               location=&amp;quot;Downstream&amp;quot; 
               duration=&amp;quot;1000&amp;quot; 
               enabled=&amp;quot;true&amp;quot;/&amp;gt;
        &amp;lt;/outputCacheProfiles&amp;gt;
      &amp;lt;/outputCacheSettings&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h5&gt;Append a query string&lt;/h5&gt;

&lt;p&gt;Providing a query string on the request affects the Cache-control header. Even if you add just a “?” after the URL path, the OutputCache module will then emit your intended max-age.&lt;/p&gt;

&lt;h5&gt;Disable OutputCache module – via config&lt;/h5&gt;

&lt;p&gt;You can do this by removing it from the ASP.NET pipeline altogether, or remove it in the sub-path where /cnd is located (or Virtual Application – see section later). This disables all Output caching for all requests.&lt;/p&gt;

&lt;h5&gt;Disable OutputCache module – via code – per request&lt;/h5&gt;

&lt;p&gt;You can also choose to bypass the OutputCache by affecting the Response with the following code&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;public void ProcessRequest(HttpContext context)
{
    using (var image = ImageUtil.RenderImage(…)
    {
       context.Response.Cache.SetCacheability(HttpCacheability.Public);
       context.Response.Cache.SetMaxAge(TimeSpan.FromMinutes(Config.MA));
       context.Response.Cache.SetNoServerCaching();
       context.Response.ContentType = &amp;quot;image/jpeg&amp;quot;;
       image.Save(context.Response.OutputStream, ImageFormat.Jpeg);
       context.Response.OutputStream.Flush();
    }
}&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h5&gt;Implement your own OutputCache module&lt;/h5&gt;

&lt;p&gt;You can take a look at the links in the section on implementing your own OutputCache module to get an idea on the implementation effort, but the reasoning why you would want to is varied – which I’ll cover a couple of reasons in that section.&lt;/p&gt;

&lt;h3&gt;Vary:* Headers and Caching&lt;/h3&gt;

&lt;p&gt;Ensure you’re not emitting Vary:* by headers at all if you want to take advantage of caching – either with the Windows Azure CDN or not – as the specification indicates responses with Vary:* should not be cached and only handled at the origin.&lt;/p&gt;

&lt;p&gt;From RFC2616: &amp;quot;A Vary header field-value of &amp;quot;*&amp;quot; always fails to match and subsequent requests on that resource can only be properly interpreted by the origin server.&amp;quot;&lt;/p&gt;

&lt;h3&gt;Compressed content with the CDN&lt;/h3&gt;

&lt;p&gt;One of the reasons you would want to move your origin from Windows Azure Storage to a Hosted Service is to take advantage of compression. As part of IIS7.x, you can ensure that static and dynamic compression is enabled for your content – this will then cascade through to the Windows Azure CDN and provide an overall better experience for your end users.&lt;/p&gt;

&lt;h3&gt;Use of IIS Virtual Application / Directories under Windows Azure&lt;/h3&gt;

&lt;p&gt;Today, using Hosted Service as an origin to Windows Azure CDN requires a production deployment of your service listening at the path http&lt;img src="http://cicoria.com/cs1/emoticons/emotion-56.gif" alt="Sleep" /&gt;://yourserviceDnsName:80|443/cdn. Currently we do not support Hosted Services as origins in staging.&lt;/p&gt;

&lt;p&gt;All that is required is that your service provide responses under the /cdn path. You can achieve this with a WebRole that has a directory (path) under your main site.&lt;/p&gt;

&lt;p&gt;What happens if you need (or desire) to isolate that path (/cdn)? Under Windows Azure, you can take advantage of IIS Virtual Applications / Directories under your main WebRole.&lt;/p&gt;

&lt;p&gt;The following Service Definition illustrates the approach by taking advantage of the Full IIS model and the VirtualApplication element. The key to the approach here for your solution in the development fabric is to ensure the physical directory is relative to the MainWeb path.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;ServiceDefinition name=&amp;quot;TR13VirtualApp&amp;quot; xmlns=&amp;quot;http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition&amp;quot;&amp;gt;
  &amp;lt;WebRole name=&amp;quot;MainWeb&amp;quot; vmsize=&amp;quot;ExtraSmall&amp;quot;&amp;gt;
    &amp;lt;Sites&amp;gt;
      &amp;lt;Site name=&amp;quot;Web&amp;quot;&amp;gt;
        &amp;lt;VirtualApplication name=&amp;quot;cdn&amp;quot; physicalDirectory=&amp;quot;../MainWebCdn&amp;quot; /&amp;gt;
        &amp;lt;Bindings&amp;gt;
          &amp;lt;Binding name=&amp;quot;Endpoint1&amp;quot; endpointName=&amp;quot;Endpoint1&amp;quot; /&amp;gt;
        &amp;lt;/Bindings&amp;gt;
      &amp;lt;/Site&amp;gt;
    &amp;lt;/Sites&amp;gt;
    … &lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;This results in a deployment up on Windows Azure as the following – with a single site, and 2 application pools:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_3A7E82B5.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_3939E9D6.png" width="544" height="177" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Simple VS2010 Solution is also provided at the end of the post and the following links provide further detail:&lt;/p&gt;

&lt;h4&gt;Creating Virtual Applications / Directories&lt;/h4&gt;

&lt;p&gt;The Windows Azure Training kit contains a sample walkthrough that demonstrates the approach.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/wazplatformtrainingcourse_advancedwebandworkerrolesvs2010lab_topic2.aspx"&gt;http://msdn.microsoft.com/en-us/wazplatformtrainingcourse_advancedwebandworkerrolesvs2010lab_topic2.aspx&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Additionally, Wade Wegner goes into a bit of detail as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.wadewegner.com/2011/02/running-multiple-websites-in-a-windows-azure-web-role/"&gt;http://www.wadewegner.com/2011/02/running-multiple-websites-in-a-windows-azure-web-role/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Why provide your own OutputCache module implementation?&lt;/h3&gt;
So, what would make you want to write your own OutputCache module implementation? Recall that the Service model when you have many instances in your Windows Azure Role may result in different host instances servicing requests. 

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_2A230AFC.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_767A9E9D.png" width="499" height="313" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;If that content is VERY expensive to produce….&lt;/h4&gt;

&lt;p&gt;You now have N (# of instances) producing possibly exact or similar replicas of your content. Not exactly a desirable effect if your transaction costs are high (maybe you’re reaching out to external services, or on premise mainframes, etc.)&lt;/p&gt;

&lt;h4&gt;Take advantage of Windows Azure AppFabric Caching&lt;/h4&gt;

&lt;p&gt;Either replacing the OutputCache module with your own implementation, or leveraging your own request model (that will still work with or bypass the OutputCache module) you can instantiate a single copy of that content in AppFabric Caching – thereby reducing the overall cost associated with repetitive content creation. Whatever your choice, ensure to factor in operational costs of AppFabric to see if it meets your economic model.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_03084BBA.png"&gt;&lt;img style="background-image:none;border-right-width:0px;padding-left:0px;padding-right:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px;" title="image" border="0" alt="image" src="http://cicoria.com/cs1/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/cedarlogic/image_5F00_thumb_5F00_4597E732.png" width="544" height="288" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h4&gt;Implement your own OutputCache&lt;/h4&gt;

&lt;p&gt;The following links provide some guidance on replacing OutputCache module – which can be done at the /cdn path level if required.&lt;/p&gt;

&lt;h5&gt;Custom OutputCacheProvider&lt;/h5&gt;

&lt;p&gt;The following is a sample implementation of a custom OutputCache module under NetFx 4.0.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/gunnarpeipman/archive/2009/11/19/asp-net-4-0-writing-custom-output-cache-providers.aspx"&gt;http://weblogs.asp.net/gunnarpeipman/archive/2009/11/19/asp-net-4-0-writing-custom-output-cache-providers.aspx&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;ASP.NET 4.0 Caching Overview&lt;/h5&gt;

&lt;p&gt;Check out the following link on ASP.NET 4.0 caching in general to get an idea of OutputCache module.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178597.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms178597.aspx&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;Solution Files&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/downloads/waz/CdnTest.zip"&gt;CDN Test Solution&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cicoria.com/downloads/waz/VirtualApp.zip"&gt;Virtual App Sample&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://cicoria.com/cs1/aggbug.aspx?PostID=2916" width="1" height="1"&gt;</description><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Azure/default.aspx">Azure</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Troubleshooting/default.aspx">Troubleshooting</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Code/default.aspx">Code</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/Caching/default.aspx">Caching</category><category domain="http://cicoria.com/cs1/blogs/cedarlogic/archive/tags/CDN/default.aspx">CDN</category></item></channel></rss>
