Giter VIP home page Giter VIP logo

storage-blobs-node-quickstart's Introduction

Storage Blobs Quickstart

WARNING You are viewing a tutorial for the legacy version of the Azure Storage Node.js SDK. Please go here to view the latest JavaScript SDK (v10).

The following sample includes the following features:

  • Uses async/await: The Azure Storage SDK API is still callback-based, but the approach in this sample modernizes the syntax. API calls are wrapped in Promises and are executed in the context of an async/await operation.

  • Uses environment variables: This sample accesses the connection string from an environment variable. The use of environment variables is representative of how you would access sensitive information in production.

To run this sample, you need an Azure account, a blob storage account, and the associated blob storage connection string.

Set up

First, clone the repository on your machine:

git clone https://github.com/Azure-Samples/storage-blobs-node-quickstart.git

Then, switch to the appropriate folder:

cd storage-blobs-node-quickstart

Next, install the dependencies:

npm install

Now, add your blob storage connection string as an environment variable named AZURE_STORAGE_CONNECTION_STRING to a file named .env.

Note: This repository includes a file named .env.example. You can rename this file by removing .example and adding the correct value for your connection string in the .env file.

Running the sample

Once the setup, you can run the sample by using npm start.

npm start

When complete, the application should produce output similar to the following:

Containers:
 - container-one
 - container-two
Container "demo" is created
Blob "quickstart.txt" is uploaded
Local file "./readme.md" is uploaded
Blobs in "demo" container:
 - quickstart.txt
 - readme.md
Blob downloaded blob content: "hello Blob SDK"
Blob "quickstart.txt" is deleted
Container "demo" is deleted
Done

Resources

You can use the Azure Storage explorer to see the data in your Azure account.

storage-blobs-node-quickstart's People

Contributors

craigshoemaker avatar microsoftopensource avatar georgewallace avatar tamram avatar msftgits avatar xiaoningliu avatar

Watchers

James Cloos avatar karlitxo avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.