سؤال

I need to read blob data quickly. However it seems that FetchAttributes() and OpenRead() methods each do an access to storage. My blobs are really small, so I wish I could read everything in a single access. Is that possible?

The only attribute I'm interested is ETag. I want it to do efficient and conflict-aware updates and deletes to blob contents.

هل كانت مفيدة؟

المحلول

According to MSDN you're stuck with a 2 step process:

"Retrieving property and metadata values for a resource is a two-step process. Before you can read these values, you must explicitly fetch them on your CloudBlobContainer, CloudBlockBlob, or CloudPageBlob objects. To fetch properties and metadata synchronously, call FetchAttributes on the container or blob; to fetch them asynchronously, call BeginFetchAttributes and EndFetchAttributes."

نصائح أخرى

Assuming you know the type of your blob and you want to download all properties, metadata, and the contents of the blob, you can directly call DownloadToStream.

DownloadToStream internally makes a Get Blob request, which returns blob's properties and metadata.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top