Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a bunch of images stored as blobs in Azure Storage
I also have a website ( hosted on azure, but (i think) that is irrelevant)
What is the easiest way for me to show that Image on the website as part of an Image tag.
I would like to limit myself to services offered by Azure.

As of now I can think of this solution
1) Host a Rest API within a WCF Service,This Rest API will return an image
2) A url to the rest API can be provided from within the image tag.

Is this the best way to do it ?

Note, I do not care so much about performance or scalability right now. I just want to get this working.
Posted

1 solution

hi AmitDey,

You can azure blob services can be accessed as an URI LINKS you can directly access
1) Just remove the blob protection mode from private to public so that you can access them.
2) Azure blob services are given out as service to PUBLIC as REST services so your application should not face issue with any kind of devices too

if you are good to go with these criterias then use the below code to get the rerence URI from "blockBlob "

// Retrieve storage account from connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
    CloudConfigurationManager.GetSetting("StorageConnectionString"));

// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

// Retrieve reference to a previously created container.
CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");

// Retrieve reference to a blob named "photo1.jpg".
CloudBlockBlob blockBlob = container.GetBlockBlobReference("photo1.jpg");



thanks you
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900