Skip to content

Commit ff2c085

Browse files
authored
Merge pull request #96298 from mhopkins-msft/master
Updated code snippets
2 parents d06d6b0 + 0792fa9 commit ff2c085

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

articles/storage/blobs/storage-quickstart-blobs-nodejs.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: In this quickstart, you learn how to use the Azure Blob storage cli
44
author: mhopkins-msft
55

66
ms.author: mhopkins
7-
ms.date: 11/05/2019
7+
ms.date: 11/19/2019
88
ms.service: storage
99
ms.subservice: blobs
1010
ms.topic: quickstart
@@ -101,7 +101,7 @@ From the project directory:
101101
const uuidv1 = require('uuid/v1');
102102

103103
async function main() {
104-
console.log('Azure Blob storage v12 - Javascript quickstart sample');
104+
console.log('Azure Blob storage v12 - JavaScript quickstart sample');
105105
// Quick start code goes here
106106
}
107107

@@ -207,7 +207,7 @@ Add this code to the end of the `main` function:
207207

208208
```javascript
209209
// 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);
211211
212212
// Create a unique name for the container
213213
const containerName = 'quickstart' + uuidv1();
@@ -219,7 +219,8 @@ console.log('\t', containerName);
219219
const containerClient = await blobServiceClient.getContainerClient(containerName);
220220
221221
// Create the container
222-
await containerClient.create();
222+
const createContainerResponse = await containerClient.create();
223+
console.log("Container was created successfully. requestId: ", createContainerResponse.requestId);
223224
```
224225

225226
### Upload blobs to a container
@@ -239,11 +240,12 @@ const blobName = 'quickstart' + uuidv1() + '.txt';
239240
// Get a block blob client
240241
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
241242
242-
console.log('\nUploading to Azure Storage as blob:\n\t', blobName);
243+
console.log('\nUploading to Azure storage as blob:\n\t', blobName);
243244
244245
// Upload data to the blob
245246
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);
247249
```
248250

249251
### List the blobs in a container
@@ -304,7 +306,8 @@ Add this code to the end of the `main` function:
304306
console.log('\nDeleting container...');
305307

306308
// Delete container
307-
await containerClient.delete();
309+
const deleteContainerResponse = await containerClient.delete();
310+
console.log("Container was deleted successfully. requestId: ", deleteContainerResponse.requestId);
308311
```
309312
310313
## Run the code

0 commit comments

Comments
 (0)