Reputation: 13356
I'm confused about how to get size of the blob in Windows Azure.
In my case, I first get the blob reference with CloudBlockBlob blob = container.GetBlockBlobReference(foo);
(here foo is name of blob and I'm sure the blob exists). Then I try to get blob size blob.Property.Length;
However, it always return 0
. I breakpoint at this statement and track content inside blob
: uri
of the blob is correct, can I infer that the blob is correctly retrieved from that? While all the fields in Properties
is either null
or 0
. I cannot figure out a solution. Is it because I currently emulate the app locally in Storage Emulator
and will be OK after the deployment?
Thanks and Best Regards.
Upvotes: 9
Views: 4611
Reputation: 20556
I have written a blog on exact same issue about 4 days back:
Upvotes: 3
Reputation: 60143
Call blob.FetchAttributes()
. GetBlockBlobReference
doesn't actually make any calls to the blob service. It just constructs a local object that represents the blob.
Upvotes: 24