Troubleshooting Windows Azure drive initialization

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

 

Issue I: Drives do not support https

Exception of type 'Microsoft.WindowsAzure.CloudDrive.Interop.InteropCloudDriveException' was thrown.

[HttpException (0x80004005): ERROR_HTTPS_NOT_SUPPORTED]

Solution

Use HTTP be removing ‘S’ (see below).

<Setting name="CloudStorageAccount" value="DefaultEndpointsProtocol=https;AccountName=xyz..=" />
 

Issue II:  UnauthorizedAccessException on local cache initialization:

When you try to initialize the drive in Windows Azure you will implement peace of code like this one:

LocalResource
localCache = RoleEnvironment.GetLocalResource("MyAzureDriveCache");

CloudDrive.InitializeCache(localCache.RootPath, localCache.MaximumSizeInMegabytes);

Depending on type and value of ‘MyAzureDriveCache, the cache initialization of the drive can succeed or fail. If this variable is a string which defines the physical path like “c:\mycachefolder”, you will probably run into following issue.

[UnauthorizedAccessException]
Cannot access the path … Access denied.

Solution:

If the drive mount is created within IIS host, this will for sure fail. To avoid this issue, you have to ensure that MyAzureCache is defined in config-Resources and not in settings.

image

 

This is how this does looks like in ServiceDefinition.csdef:

   
<
LocalResources>
      <LocalStorage name="MyAzureDriveCache" cleanOnRoleRecycle="false" sizeInMB="100" />
    </LocalResources>

Issue III:

Cannot combine incompatible absolute URIs base 'http://xy.blob.core.windows.net/' relative 'http://xy.blob.core.windows.net/documents/drive.vhd'.When trying to combine 2 absolute URIs, the base URI should be a valid base of the relative Uri.

You have used the Drive URI like:
http://xy.blob.core.windows.net/documents/drive.vhd

You should use following URI:
documents/drive.vhd

Please note that following is not allowed too (note the slash at the beginning): /documents/drive.vhd

Issue IV: How to upload Page-Blob

After all, when you think all issues have been fixed, you might get following error:

ERROR_BLOB_NOT_PAGEBLOB

This is one of errors which really describes the exact problem. You are trying to mount to blob which is uploaded as block-blob and not as Page-Blob.

Issue V: How to upload huge blobs?

Take a look on Kevin's sample which asynchronously transfers huge amount of data:
http://blogs.msdn.com/b/kwill/archive/2011/05/30/asynchronous-parallel-block-blob-transfers-with-progress-change-notification.aspx


Posted Jan 16 2012, 10:58 PM by Damir Dobric
Filed under: , ,
developers.de is a .Net Community Blog powered by daenet GmbH.