locked
how to select blob using metadata properties? RRS feed

  • Question

  • i want to select the blob by matching one of its metadata properties??how should i do?? i want the user to type property such as name or id and than i should match it from the blobs and retrieve the specified blob...
    Friday, October 1, 2010 7:24 AM

Answers

  • Hi,

    Blob storage does not allow you to query blobs on its metadata. So I guess you have two options:

    1. Fetch all blobs from a blob container and then enumerate over them to find out which blob has a metadata specified by the user.

    2. Keep metadata in table storage along with blob URL. That way you can query table storage to find the desired blob and fetch it from blob storage. However you may want to design your table storage in such a way so that your query does not do a complete table scan. Essentially you would need to ensure that your query includes PartitionKey value along with one of the metadata attribute.

    Hope this helps.

    Thanks

    Gaurav Mantri

    Cerebrata Software

    http://www.cerebrata.com

    Friday, October 1, 2010 7:53 AM

All replies

  • Hi,

    Blob storage does not allow you to query blobs on its metadata. So I guess you have two options:

    1. Fetch all blobs from a blob container and then enumerate over them to find out which blob has a metadata specified by the user.

    2. Keep metadata in table storage along with blob URL. That way you can query table storage to find the desired blob and fetch it from blob storage. However you may want to design your table storage in such a way so that your query does not do a complete table scan. Essentially you would need to ensure that your query includes PartitionKey value along with one of the metadata attribute.

    Hope this helps.

    Thanks

    Gaurav Mantri

    Cerebrata Software

    http://www.cerebrata.com

    Friday, October 1, 2010 7:53 AM
  • can u cite an example....??
    Monday, October 4, 2010 6:44 PM