When you are uploading blobs from a stream using multiple roles (web or worker) to a single azure storage location it is possible that you may hit the following exception:

 

System.ArgumentException: Waithandle array may not be empty.

at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()

at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()

at Microsoft.WindowsAzure.StorageClient.CloudBlob.UploadFromStream(Stream source, BlobRequestOptions options)

at Contoso.Cloud.Integration.Azure.Services.Framework.Storage.ReliableCloudBlobStorage.UploadBlob(CloudBlob blob, Stream data, Boolean overwrite, String eTag)

 

 

Reason: 

The above issue is caused by a known issue, when utilizing parallel uploading for blobs in Storage API and it could occur in very rare occasion if conditions are matched for this issue to appear.

 

Solution:

To solve this problem please disable parallel upload feature by setting as below: CloudBlobClient.ParallelOperationThreadCount=1