tensai tensai - 3 months ago 53
Node.js Question

Weird results from Blob Storage save action?

I am using the nodejs blob storage client to store a file in Azure blob storage.

return new Rx.Observable.create(function (observer) {
_this.blobClient.createBlockBlobFromLocalFile("protofiles", path, e.file, function (error, result, response) {
if (!error) {
console.log("res: ", result);

This returns the results in the following format:

res: BlobResult {
container: 'protofiles',
name: 'data/d812a55b-5631-4b40-81a9-e80151533112',
lastModified: 'Tue, 08 Nov 2016 12:14:29 GMT',
etag: '"0x8D407D0CA7952D5"',
requestId: 'ecfd5758-0001-0062-24b9-396984000000',
contentSettings: { contentMD5: '846vto3oRsaB0whXPDpZVw==' }

Which means the results have to first go through a process of string manipulation before JSON can be extracted out of this. This doesn't feel normal and I was wondering if anyone had any experience with this sort of weirdly formed data.

I tried parsing the JSON on jsonlint.com and I get the following results:



The result in the callback function is a BlobResult object. I am not sure what do you mean weird result, and also not sure what's your requirement. But As it is a object, you can directly get its properties in result.{propertyName}.

Any further concern, please feel free to let me know.