@@ -4,7 +4,7 @@ description: In this quickstart, you learn how to use the Azure Blob storage cli
4
4
author : mhopkins-msft
5
5
6
6
ms.author : mhopkins
7
- ms.date : 11/05 /2019
7
+ ms.date : 11/19 /2019
8
8
ms.service : storage
9
9
ms.subservice : blobs
10
10
ms.topic : quickstart
@@ -101,7 +101,7 @@ From the project directory:
101
101
const uuidv1 = require (' uuid/v1' );
102
102
103
103
async function main () {
104
- console .log (' Azure Blob storage v12 - Javascript quickstart sample' );
104
+ console .log (' Azure Blob storage v12 - JavaScript quickstart sample' );
105
105
// Quick start code goes here
106
106
}
107
107
@@ -207,7 +207,7 @@ Add this code to the end of the `main` function:
207
207
208
208
` ` ` javascript
209
209
// Create the BlobServiceClient object which will be used to create a container client
210
- const blobServiceClient = await new BlobServiceClient.fromConnectionString(CONNECT_STR);
210
+ const blobServiceClient = await BlobServiceClient.fromConnectionString(CONNECT_STR);
211
211
212
212
// Create a unique name for the container
213
213
const containerName = 'quickstart' + uuidv1();
@@ -219,7 +219,8 @@ console.log('\t', containerName);
219
219
const containerClient = await blobServiceClient.getContainerClient(containerName);
220
220
221
221
// Create the container
222
- await containerClient.create();
222
+ const createContainerResponse = await containerClient.create();
223
+ console.log("Container was created successfully. requestId: ", createContainerResponse.requestId);
223
224
` ` `
224
225
225
226
### Upload blobs to a container
@@ -239,11 +240,12 @@ const blobName = 'quickstart' + uuidv1() + '.txt';
239
240
// Get a block blob client
240
241
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
241
242
242
- console.log('\n Uploading to Azure Storage as blob:\n\t ', blobName);
243
+ console.log('\n Uploading to Azure storage as blob:\n\t ', blobName);
243
244
244
245
// Upload data to the blob
245
246
const data = 'Hello, World!';
246
- await blockBlobClient.upload(data, data.length);
247
+ const uploadBlobResponse = await blockBlobClient.upload(data, data.length);
248
+ console.log("Blob was uploaded successfully. requestId: ", uploadBlobResponse.requestId);
247
249
` ` `
248
250
249
251
### List the blobs in a container
@@ -304,7 +306,8 @@ Add this code to the end of the `main` function:
304
306
console .log (' \n Deleting container...' );
305
307
306
308
// Delete container
307
- await containerClient .delete ();
309
+ const deleteContainerResponse = await containerClient .delete ();
310
+ console .log (" Container was deleted successfully. requestId: " , deleteContainerResponse .requestId );
308
311
` ` `
309
312
310
313
## Run the code
0 commit comments