I am facing a problem. I have to implement a solution to load multiple images from Azure Blob Storage in Xamarin.Forms app.
I would like to know how to send List of image names and get List of images back from Azure Blob Storage Account.
Thank you !
Azure Blob doesn't have a strong query\search story. If you know the container you could always iterate through the blobs in that container but this is going to be very inefficient and less then ideal. You can also use Azure Search to index blob storage (and it's contents) but I find that overkill for your use case.
My suggestion is to store a reference to the blob in a searchable data source. If you already have a data source in place for your app (such as SQL) I would use that.
One inexpensive way to get this into your data source to query later is to use an Azure Function or Logic App to trigger when a new blob is created and store the data you need to later find it (e.g. the filename) along with the blob reference. Table storage is a very inexpensive method or you can use any data store you like. You can then host an API endpoint in Azure Functions (or your host of choice) where your Xamarin app can pass in the filenames and get the results back.
With Azure Functions the code for a a blob trigger that writes to table storage is pretty minimal and would follow something like the pattern below:
public static void Run(
[BlobTrigger("mycollection/{name}")] BlobProperties blobProperties,
[Table("blobdata")]IAsyncCollector<MyBlobDataPoco> tableData,
string name, TraceWriter log)
{
var myData = new MyBlobDataPoco() { Filename = name, Container= "mycollection" };
tableData.AddAsync(myData);
}