Note that there are some explanatory texts on larger screens.

plurals
  1. POazure reading mounted VHD
    primarykey
    data
    text
    <p>I am developing "azure web application". </p> <p>I have created drive and drivePath static members in WebRole as follows:</p> <pre><code>public static CloudDrive drive = null; public static string drivePath = ""; </code></pre> <p>I have created development storage drive in WebRole.OnStart as follows:</p> <pre><code>LocalResource azureDriveCache = RoleEnvironment.GetLocalResource("cache"); CloudDrive.InitializeCache(azureDriveCache.RootPath, azureDriveCache.MaximumSizeInMegabytes); CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =&gt; { // for a console app, reading from App.config //configSetter(ConfigurationManager.AppSettings[configName]); // OR, if running in the Windows Azure environment configSetter(RoleEnvironment.GetConfigurationSettingValue(configName)); }); CloudStorageAccount account = CloudStorageAccount.DevelopmentStorageAccount; CloudBlobClient blobClient = account.CreateCloudBlobClient(); blobClient.GetContainerReference("drives").CreateIfNotExist(); drive = account.CreateCloudDrive( blobClient .GetContainerReference("drives") .GetPageBlobReference("mysupercooldrive.vhd") .Uri.ToString() ); try { drive.Create(64); } catch (CloudDriveException ex) { // handle exception here // exception is also thrown if all is well but the drive already exists } string path = drive.Mount(azureDriveCache.MaximumSizeInMegabytes, DriveMountOptions.None); IDictionary&lt;String, Uri&gt; listDrives = Microsoft.WindowsAzure.StorageClient.CloudDrive.GetMountedDrives(); drivePath = path; </code></pre> <p>The drive keeps visible and accessible till execution scope remain in WebRole.OnStart, as soon as execution scope leave WebRole.OnStart, drive become unavailable from application and static members get reset (such as drivePath get set to "")</p> <p>Am I missing some configuration or some other error ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload