Summer_More_More_Tea
Summer_More_More_Tea

Reputation: 13356

Windows Azure: length of blob remains 0

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

Answers (2)

user94559
user94559

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

Related Questions