Skip to content

Instantly share code, notes, and snippets.

@mebjas
Created April 3, 2018 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mebjas/c28e7969affd203fc694a6061d07ebb3 to your computer and use it in GitHub Desktop.
Save mebjas/c28e7969affd203fc694a6061d07ebb3 to your computer and use it in GitHub Desktop.
md5checkdisbale.cs
//// Upload data to blob
public void UploadData(DataModel data, string blobName) {
BlobRequestOptions blobRequestOption = new BlobRequestOptions()
{
DisableContentMD5Validation = false
};
//// define cloudBlobContainer above
CloudBlockBlob blockBlob = cloudBlobContainer.GetBlockBlobReference(blobName);
blockBlob.UploadText(
JsonConvert.SerializeObject(data),
options: blobRequestOption);
}
//// Upload data to blob
public DataModel DownloadData(string blobName) {
BlobRequestOptions blobRequestOption = new BlobRequestOptions()
{
DisableContentMD5Validation = false
};
//// define cloudBlobContainer above
CloudBlockBlob blockBlob = cloudBlobContainer.GetBlockBlobReference(blobName);
string data = blockBlob.DownloadText(options: blobRequestOption);
return JsonConvert.DeserializeObject<DataModel>(data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment