Pointing Azure Web role Virtual directory to Azure Xdrive folder RRS feed

  • Question

  • Hi

    I created Windows Azure XDrive and mounted it in my application.

    now i created virtual directory in my azure web application.

    The following code i added in WebRole class OnStart method


    using (var serverManager = new ServerManager())
            var siteApplication = serverManager.Sites[RoleEnvironment.CurrentRoleInstance.Id + "_" + webApplicationProjectName].Applications.First();
            var appPoolName = siteApplication.ApplicationPoolName;
            ApplicationPool appPool = serverManager.ApplicationPools[appPoolName];
            //appPool.ProcessModel.IdleTimeout = TimeSpan.Zero;
            //appPool.Recycling.PeriodicRestart.Time = TimeSpan.Zero;
            Application site = serverManager.Sites[1].Applications.Add("/childApp", myDrive.DriveLetter + "testapp");
            site.ApplicationPoolName = appPool.Name;

    I am executing this code on local system using emulator. If i point to any other directory in my drive like D:\testApp , this code is working fine and i can browse the contents of that folder after i execute my azure web app.

    But if i point it to Azure XDrive folder having same contents of D:\testApp . i am getting this error


    HTTP Error 500.19 - Internal Server Error

    The requested page cannot be accessed because the related configuration data for the page is invalid.


    The Azure Xdrive contains a folder testapp and in this folder , i have put web contents , i want to browse that contents after pointing the virtual directory of web role to that Xdrive folder.
    Friday, June 3, 2011 12:43 PM


All replies

  • When you launch the application locally in the compute emulator, the Azure Drive simulation uses a "substed" drive that is only available to the user that mounts the drive. If you mount the drive in OnStart and the role is running in full IIS mode, the site will execute under a different user context and does not have access to the simulated drive. If you can, mount the drive in Application_Start; otherwise, switch to hosted web core by commenting out the <sites> element in the servicedefinition.csdef file.


    Friday, June 3, 2011 1:35 PM
  • Thanks Fernando for your reply. 

    When i create virtual directory in Azure VM, i am able to point it to physical folder in my Windows Drive and its working fine. but when i point the Virtual directory to Azure Xdrive, it does not work.

    Actually what i found is as follows

    1) When you create Azure XDrive its like a mapped drive having letter like A:\ etc

    2) IIS does not works with mapped drive, one way to deal with this issue is that convert it to UNC path like shared folder in windows.

    3) Usually shared folder name is in convention of <systemname>//<foldername> , so i think that shared folder can not be created here in azure as it is running in VM ( not sure about this )

    so if anyone having the idea of pointing Virtual directory in VM to XDrive path like A:\abc then please let me know




    Monday, June 6, 2011 8:30 AM
  • Wednesday, June 8, 2011 9:26 PM

    Hi please view the screenshots and comments here


    bill boyce

    Hi Bill,

    This link does not work. can you share it again.


    Thursday, June 9, 2011 10:58 AM
  • Hi,

    Sorry..... try it again the permissions were changed to everyone

    bill boyce
    Thursday, June 9, 2011 1:20 PM
  • Hi Bill, 
    Thanks for you reply and your solution. 
    Actually i am using Azure SDK Emulator for testing my application. Whenever i mount XDrive in my web role app, a drive letter is assigned like A:\ , i am unable to see this drive in windows explorer (using Windows 7) but in your solution azure Xdrive is visible in windows explorer, how to do this ??
    As i am using emulator, so it is mapped to a physical location in my C:\ drive i.e.  C:\Users\yasser\AppData\Local\dftmp\wadd\devstoreaccount1
    If i use this path map my virtual directory (Web Role IIS) to C:\Users\yasser\AppData\Local\dftmp\wadd\devstoreaccount1 it is working fine
    but if use mounted drive letter i.e A:\ it is not working.
    How to show mounted drive like A:\ in windows explorer ?? are you using live environment or development environment 

    Friday, June 10, 2011 7:15 AM
  • You should read this post on the Azure Drive simulation by the Windows Azure Storage Team.
    Friday, June 10, 2011 8:13 AM