Skip to content

Instantly share code, notes, and snippets.

@panreel
panreel / upload-blob-azure.js
Last active November 6, 2022 09:29
Upload a binary data from request body to Azure BLOB storage in Node.js [restify]
//NOTE: Do not use restify.bodyParser() - it blocks piping
//vars
var azure = require('azure-storage');
// ... BLOB connection skipped ...
//Option 1 - Piping req stream to BLOB write stream (elegant)
function (req, res, next) {
//create write stream for blob
var stream = azure.createWriteStreamToBlockBlob(