i'm experiencing 403 error when attempting use azure's node.js sdk. function below works when call directly:
module.exports = function (file, callback) { if (!fs.existssync('./data')) { mkdirp('./data', function (err) { if (err) console.log(err) }) } fileservice.getfiletostream('chatbot', '', file, fs.createwritestream('data/' + file), function (err, res, response) { if (!err) { fs.readfile('data/' + file, 'utf8', function (err, data) { if (!err) { callback(null, data) } else { callback(err) } }) } else { callback(err) } }) }
however, when call wider application receive 403 error:
{ storageerror: forbidden @ function.storageserviceclient._normalizeerror (/users/tombarton/sites/testapplication/node_modules/azure-storage/lib/common/services/storageserviceclient.js:1174:23) @ fileservice.storageserviceclient._processresponse (/users/tombarton/sites/testapplication/node_modules/azure-storage/lib/common/services/storageserviceclient.js:729:50) @ request.processresponsecallback [as _callback] (/users/tombarton/sites/testapplication/node_modules/azure-storage/lib/common/services/storageserviceclient.js:310:37) @ request.self.callback (/users/tombarton/sites/testapplication/node_modules/azure-storage/node_modules/request/request.js:187:22) @ emittwo (events.js:106:13) @ request.emit (events.js:191:7) @ request.<anonymous> (/users/tombarton/sites/testapplication/node_modules/azure-storage/node_modules/request/request.js:1044:10) @ emitone (events.js:96:13) @ request.emit (events.js:188:7) @ incomingmessage.<anonymous> (/users/tombarton/sites/testapplication/node_modules/azure-storage/node_modules/request/request.js:965:12) name: 'storageerror', message: 'forbidden', code: 'forbidden', statuscode: 403, requestid: '51ce6605-001a-00c1-1d52-ae966b000000' }
the problem can't seem debug further 403 error. code works independently know access keys aren't problem. azure storage allows log access data tables, blobs , queues, not file service, seems incredibly frustrating (https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/enabling-storage-logging-and-accessing-log-data#howtoenablestorageloggingusingthewindowsazuremanagementportal).
has got ideas regarding how debug further?
there issue in applicationinsights package causes 403 responses storage. issue fixed in version 0.18.0.
Comments
Post a Comment