Azure Storage Blob Upload from a Node.js Web Application

This sample demonstrates how to use the Azure Storage SDK in the context of an Express application to upload images into Azure Blob Storage.

Getting started

Clone the repository to your machine:

git clone https://github.com/Azure-Samples/storage-blob-upload-from-webapp-node.git

Change into the storage-blob-upload-from-webapp-node folder:

cd storage-blob-upload-from-webapp-node

Install dependencies via npm:

npm install

Adding a connection string

Navigate to the Azure Portal and copy the connection string from your storage account (under Settings > Access keys) in to the .env.example file, where indicated.

You must also specify the name of the Blob Storage container that you want to use, and that must already exist in your account, where indicated.

Once you have pasted your connection string in to the file, rename the file from .env.example to .env.

Running the sample

Start the server:

npm start

Navigate to http://localhost:3000 and upload an image to blob storage.

You can use the Azure Storage Explorer to view blob containers and verify your upload is successful.