I have stored json data format in azure blob storage, Now want to retrieve that data from azure blob in the form of json.
I tried like following
//get all blob from contrainer
var storageAccount = CloudStorageAccount.Parse("connection string");
var blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("tablesblob");
foreach (IListBlobItem item in container.ListBlobs(null, false))
{
if (item.GetType() == typeof(CloudBlockBlob))
{
CloudBlockBlob blob = (CloudBlockBlob)item;
var ms = new MemoryStream();
//blob.DownloadToStream(ms); how to get blob data in the form of JSON?
}
}
how to get azure blob data in the form of JSON?
You can store JSON data in Oracle Database using columns whose data types are VARCHAR2 , CLOB , or BLOB .
Azure Table Storage is a key/value pair store (much like Amazon DynamoDB). With the latest changes to storage service announced yesterday, you can work with JSON objects and save them as key/value pair in Azure table storage.
You could try CloudBlockBlob.DownloadText
method to download the blob contents as text and then use Json.Net's JsonConvert
to serialize the string into your customer object. For example, something like the following:
var customerData = blob.DownloadText();
var customer = JsonConvert.DeserializeObject<Customer>(customerData);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With