This repository has been archived by the owner on Sep 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathblobSamples.js
74 lines (64 loc) · 3.44 KB
/
blobSamples.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//----------------------------------------------------------------------------------
// Microsoft Developer & Platform Evangelism
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
//----------------------------------------------------------------------------------
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious. No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//----------------------------------------------------------------------------------
/**
* Azure Storage Blob Sample - Demonstrate how to use the Blob Storage service.
* Blob storage stores unstructured data such as text, binary data, documents or media files.
* Blobs can be accessed from anywhere in the world via HTTP or HTTPS.
*
* Documentation References:
* - What is a Storage Account - http://azure.microsoft.com/en-us/documentation/articles/storage-whatis-account/
* - Getting Started with Blobs - http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-blobs/
* - Blob Service Concepts - http://msdn.microsoft.com/en-us/library/dd179376.aspx
* - Blob Service REST API - http://msdn.microsoft.com/en-us/library/dd135733.aspx
* - Blob Service Node API - http://azure.github.io/azure-storage-node/BlobService.html
* - Delegating Access with Shared Access Signatures - http://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-shared-access-signature-part-1/
* - Storage Emulator - https://azure.microsoft.com/en-us/documentation/articles/storage-use-emulator/
*/
var basicScenarios = require('./basic');
var advancedScenarios = require('./advanced');
runBlobSamples();
function runBlobSamples() {
/**
* Instructions: This sample can be run using either the Azure Storage Emulator that installs as part of the Microsoft Azure SDK, which is available in Windows only - or by
* updating the app.config file with your connection string.
*
* To run the sample using the Storage Emulator (Microsoft Azure SDK)
* Start the Azure Storage Emulator (once only) by pressing the Start button or the Windows key and searching for it
* by typing "Azure Storage Emulator". Select it from the list of applications to start it.
*
* To run the sample using the Storage Service
* Open the app.config file and comment out the connection string for the emulator ("useDevelopmentStorage":true) and
* set the connection string for the storage service.
*
* Note: The Shared Access Signature sample currently does not work with Emulator for a well know issue in the azure-storage library. If you are planning to run
* this sample, please use the Storage Service.
*/
console.log('\nAzure Storage Blob Sample\n');
var scenarios = basicScenarios.concat(advancedScenarios);
var current = 0;
var callback = function (error) {
if (error) {
throw error;
} else {
console.log(scenarios[current].message);
current++;
if (current < scenarios.length) {
scenarios[current].action(callback);
}
}
};
scenarios[current].action(callback);
}