Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I retrieve thumbnail-URL from azure table

I have a some thumbnail in azure blob storage and thumbnail-URL in azure table. I want to retrieve thumbnail URL. After that, when I click on this URL it will show the full image from azure blob. Anybody help me. What is the query that I should use?

like image 264
shahin Avatar asked Dec 16 '25 19:12

shahin


1 Answers

The URL-click part should be as straightforward as any other embedded img link, as long as your blob is publicly accessible.

I don't know what your entity looks like, but let's just pretend you have a table called ImageDetails, and you have an entity called ImageDetail with a property called ThumbnailURL. You could query the table with something like this (you'd probably want to subclass TableServiceContext - this is a simple example):

        var imageDetailQuery = CloudStorageAccount.DevelopmentStorageAccount
            .CreateCloudTableClient()
            .GetDataServiceContext()
            .CreateQuery<ImageDetail>("ImageDetails");
        var imageDetail = (from d in imageDetailQuery where ... select d).FirstOrDefault();

At this point, assuming you have an ImageDetail object, you can just access:

imageDetail.ThumbnailURL

And build up your tag, either inline or in code:

var imgTag = String.Format("<img src=\"{0}\"...>", imageDetail.ThumbnailURL);
like image 151
David Makogon Avatar answered Dec 19 '25 21:12

David Makogon