1
votes

I'm attempting to use BlockBlobClient in a browser page to upload a file using a server-supplied sastoken / URL, similar to this C# code:

            var blob = new CloudBlockBlob(new Uri(assetUploadUrl));
            blob.UploadFromFile(FilePath, null, new BlobRequestOptions {RetryPolicy = new ExponentialRetry()});

Although the docs suggest BlockBlobClient is available in @azure/storage-blob and should be able to upload browser data from an input[type=file] element using uploadBrowserData, I can find no reference to BlockBlobClient in the browser library source. I looked into modifying the browserify export scripts but I can't find any references in the main package source either. Also the example code suggests that using @azure/storage-blog gives you a BlobServiceClient by default:

const { BlobServiceClient } = require("@azure/storage-blob");

Is BlockBlobClient actually available in the JavaScript client library?

1

1 Answers

0
votes

Okay I've figured this out, I need to use the Azure Storage client library for JavaScript, there's even a sample of doing exactly what I need to do. Now I just need to figure out how to bundle npm package files for use in Razor pages.