项目作者: vanhaxl

项目描述 :
merge all file from a container into a file and upload to another container
高级语言: JavaScript
项目地址: git://github.com/vanhaxl/azureblob-mergefile.git
创建时间: 2018-11-19T22:57:28Z
项目社区:https://github.com/vanhaxl/azureblob-mergefile

开源协议:MIT License

下载


Storage Blobs Quickstart

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:

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

Then, switch to the appropriate folder:

  1. cd storage-blobs-node-quickstart

Next, install the dependencies:

  1. 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.

  1. npm start

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

  1. Containers:
  2. - container-one
  3. - container-two
  4. Container "demo" is created
  5. Blob "quickstart.txt" is uploaded
  6. Local file "./readme.md" is uploaded
  7. Blobs in "demo" container:
  8. - quickstart.txt
  9. - readme.md
  10. Blob downloaded blob content: "hello Blob SDK"
  11. Blob "quickstart.txt" is deleted
  12. Container "demo" is deleted
  13. Done

Resources

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