0
votes

I'm uploading a data stream to Azure Storage,

I would get the link to the blob file.

let insertFile = async function (blobName,stream){
    const containerName= 'texttospeechudio';
    try{
       await blobService.createContainerIfNotExists(containerName, {
    publicAccessLevel: 'blob'},(err,result, response) => {
        if(!err) {
            console.log(result);
        }
    });
    let resultstream = blobService.createWriteStreamToBlockBlob(containerName, blobName,(err,result, response)=>{
        console.log(res)
    });
    stream.pipe(resultstream);
    stream.on('error', function (error) {
        console.log(error);
    });
    stream.once('end', function (end) {
        console.log(end)
      //OK
    });
    }
    catch(err) {
        console.log(err);
    }
}

I added createWriteStreamToBlockBlob callback , but I'm not getting inside it.

I would find a way to get uploaded file url.

1

1 Answers

3
votes

There is no file URL returned in the response according to put-blob's rest spec.

And Azure storage's resource URL can be commonly composed with following pattern:

https://{myaccount}.blob.core.windows.net/{mycontainer}/{myblob}