I have this problem when trying to upload a BLOB file to Azure, it does not happen to me with all the computers, some if they manage to upload the files. Any suggestions? Thanks
See the end of this message for more details on how to invoke Just-In-Time (JIT) debugging instead of this dialog box.
************** Text exception **************
Microsoft.WindowsAzure.Storage.StorageException: Canceled the request: The request was canceled. --- > System.Net.WebException: Voided the request: The request was canceled. in System.Net.ConnectStream.InternalWrite (Boolean async, Byte [] buffer, Int32 offset, Int32 size, Async Callback callback, Object state) System.Net.ConnectStream.Write (Byte [] buffer, Int32 offset, Int32 size) in Microsoft.WindowsAzure.Storage.Core.ByteCountingStream.Write (Byte [] buffer, Int32 offset, Int32 count) in c: \ Program Files (x86) \ Jenkins \ workspace \ release_dotnet_master \ Lib \ ClassLibraryCommon \ Core \ ByteCountingStream.cs
public class AzureStorage
{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("CadenaAzure"));
public List<string> listaAchivos { get; set; }
public string referencia { get; set; }
public void SubirBLOB()
{
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve reference to a previously created container.
CloudBlobContainer container = blobClient.GetContainerReference("respaldos");
foreach (var archivo in listaAchivos)
{
CloudBlockBlob blockBlob = container.GetBlockBlobReference(referencia +"-"+ new FileInfo(archivo).Name);
using (var fileStream = System.IO.File.OpenRead(archivo))
{
blockBlob.UploadFromStream(fileStream);
}
}
}
}