Reputation: 93
I want to store json on blob storage using azure function c#
For example my json is :
{
"a":"a",
"b":"b",
"c":[{"c1":"c1"},{"c2":"c2"}]
}
I would like to write to the file or even read from the file.
Are there any samples of writing and reading to files using Azure functions c#?
Thank You
Upvotes: 3
Views: 4157
Reputation: 784
Have a look at the CloudStorageAccount
class:
Using these you can create a CloudBlobClient
and CloudBlobContainer
. Then the CloudBlockBlob
class:
Use the CloudBlockBlob
class:
CloudBlockBlob.UploadFromByteArray(...)
to Upload, and cloudBlockBlob.DownloadToByteArray(...)
to Download your file.
Upvotes: 1