Last post Aug 06, 2018 08:40 AM by Brando ZWZ
Aug 03, 2018 01:00 PM|webfeatz|LINK
I was trying to learn about Azure and following the sample MVC app to accompany the Azure published container. In the MVC I can get my app "to run" but when I list the Blobs I see only "MyBlob". I'm trying to upload a very simple sample.txt but never see
this in "MyBlob when I call the ListBlobs procedure. In debug I looked into the fileStream object after reading in the sample.txt and saw this -
ReadTimeout = 'fileStream.ReadTimeout' threw an exception of type 'System.InvalidOperationException'
Here's some of the code - i'm a little new to C# so maybe syntax problem. Anyone else try to go through this sample app? What am I missing. I want to verify that the data is read and stored in the Azure blob in the cloud.
private CloudBlobContainer GetCloudBlobContainer()
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("test-blob-container");
public string UploadBlob()
CloudBlobContainer container = GetCloudBlobContainer();
CloudBlockBlob blob = container.GetBlockBlobReference("myBlob");
using (var fileStream = System.IO.File.OpenRead(@"c:\Test\sample.txt"))
Aug 06, 2018 08:40 AM|Brando ZWZ|LINK
As far as I know, readTimeout is a property on Stream. For most streams, including FileStream, this is not a property you can set - and will always throw this exception (by design).
From the documentation:
"The ReadTimeout property should be overridden to provide the appropriate behavior for the stream. If the stream does not support timing out, this property should raise an InvalidOperationException."
I'm trying to upload a very simple sample.txt but never see this in "MyBlob when I call the ListBlobs procedur
According to your description, I have created a test demo on my side.
I found it works well.
Could you post the codes about the listblob function?
Have you checked the file from the azure portal?