I want to mount vhd from my private container. After google I get that it is only possible through .net . I am more of a JAVA person. So I tried this code on visual studio 2012. But I keep getting exception RoleEnvironment not available. I don't know what it is please tell me how to set RoleEnvironment. Or please provide any other code which can mount my vhd.
            Asked
            
        
        
            Active
            
        
            Viewed 1,062 times
        
    1
            
            
        
        Anurag Tripathi
        
- 1,208
 - 1
 - 12
 - 31
 
1 Answers
0
            
            
        You can automate a lot of what you are trying to do using Azure Cmdlets: http://msdn.microsoft.com/en-us/library/windowsazure/jj152841
The Add-AzureDisk power shell command: http://msdn.microsoft.com/en-us/library/windowsazure/jj152837.aspx
...will allow you to add a data disk (VHD) to an existing Azure Iaas VM.
For PaaS Worker Roles look at this: http://social.msdn.microsoft.com/forums/en-us/windowsazuredevelopment/thread/6cf7de11-45f2-47ae-b84e-708b67b15f72
        Bart Czernicki
        
- 3,663
 - 1
 - 21
 - 19
 
- 
                    I need a batch script or code in c# (So that I can get an exe file) which can automatically run at startup and mount vhd. – Anurag Tripathi Nov 27 '12 at 09:15
 - 
                    I have PaaS Worker Role, so I didn't think power shell is an option for me. – Anurag Tripathi Nov 27 '12 at 13:20
 - 
                    I updated my answer, you can override the start method in a worker/web role and attach a CloudDrive VHD dynamically. – Bart Czernicki Nov 27 '12 at 13:51
 - 
                    In Worker role I Keep getting exception `ERROR_DEVFABRIC_LOCAL_MOUNT_ONLY` at `string driveLetter = drive.Mount(0, DriveMountOptions.Force);` Where I did wrong? – Anurag Tripathi Nov 29 '12 at 06:35