Επεξεργασία

Κοινή χρήση μέσω


Azure Storage samples using JavaScript client libraries

This article provides an overview of code sample scenarios found in our developer guides and samples repository. Click on the links to view the corresponding samples, either in our developer guides or in GitHub repositories.

Developer guides are collections of articles that provide detailed information and code examples for specific scenarios related to Azure Storage services. To learn more about the Blob Storage developer guides for JavaScript or TypeScript, see Get started with Azure Blob Storage and JavaScript

Note

These samples use the latest Azure Storage JavaScript v12 library. For legacy v11 code, see Getting Started with Azure Blob Service in Node.js in the GitHub repository.

Blob samples

The following table links to Azure Blob Storage developer guides and samples that use JavaScript client libraries. The developer guide links include JavaScript and TypeScript code snippets, while the sample links take you directly to the code in the GitHub repository.

Topic Developer guide Samples on GitHub
Authentication/authorization Authorize access and connect to Blob Storage

Create a user delegation SAS for a blob

Create a service SAS for a blob

Create an account SAS
Authenticate using Microsoft Entra ID:
JavaScript
TypeScript

Authenticate using shared key credential:
JavaScript
TypeScript

Authenticate using connection string:
JavaScript
TypeScript
Create container Create a container Create container:
JavaScript
TypeScript
Upload Upload a blob Upload a blob:
JavaScript
TypeScript

Parallel upload a stream to a blob:
JavaScript
TypeScript
Download Download a blob Download a blob:
JavaScript
TypeScript

Parallel download block blob:
JavaScript
TypeScript
List List containers

List blobs
List containers:
JavaScript
TypeScript

List containers using an iterator:
JavaScript
TypeScript

List containers by page:
JavaScript
TypeScript

List blobs using an iterator:
JavaScript
TypeScript

List blobs by page:
JavaScript
TypeScript

List blobs by hierarchy:
JavaScript
TypeScript
Delete Delete containers

Delete blobs
Delete a container:
JavaScript
TypeScript
Copy Overview of copy operations

Copy a blob from a source object URL

Copy a blob with asynchronous scheduling
Lease Create and manage container leases

Create and manage blob leases
Properties and metadata Manage container properties and metadata

Manage blob properties and metadata
Index tags Use blob index tags to manage and find data
Access tiers Set or change a block blob's access tier Set the access tier on a blob:
JavaScript
TypeScript
Blob service Create a blob service client:
JavaScript
TypeScript

Create blob service client using a SAS URL:
JavaScript
TypeScript
Snapshot Create a blob snapshot:
JavaScript
TypeScript

Download a blob snapshot:
JavaScript
TypeScript
Troubleshooting Trigger a recoverable error using a container client:
JavaScript
TypeScript

Data Lake Storage samples

The following table links to Data Lake Storage samples that use JavaScript client libraries:

Topic Samples on GitHub
Data Lake service Create a Data Lake service client
File system Create a file system
List file systems
List paths in a file system
Delete a file system
File Create a file
Download a file

Azure Files samples

The following table links to Azure Files samples that use JavaScript client libraries:

Topic Samples on GitHub
Authentication Authenticate using a connection string
Authenticate using a shared key credential
Authenticate using AnonymousCredential
Connect using a custom pipeline
Connect using a proxy
Share Create a share
List shares
List shares by page
Delete a share
Directory Create a directory
List files and directories
List files and directories by page
File Parallel upload a file
Parallel upload a readable stream
Parallel download a file
List file handles
List file handles by page

Queue samples

The following table links to Azure Queues samples that use JavaScript client libraries:

Topic Samples on GitHub
Authentication Authenticate using a connection string
Authenticate using a shared key credential
Authenticate using AnonymousCredential
Connect using a custom pipeline
Connect using a proxy
Authenticate using Microsoft Entra ID
Queue service Create a queue service client
Queue Create a new queue
List queues
List queues by page
Delete a queue
Message Send a message into a queue
Peek at messages

Receive messages
Delete messages

Table samples

The following table links to Azure Tables samples that use JavaScript client libraries:

Samples for deprecated client libraries are available at Azure Table Storage samples for JavaScript.

Azure code sample libraries

To view the complete JavaScript sample libraries, go to:

You can browse and clone the GitHub repository for each library.

Getting started guides

Check out the following guides if you are looking for instructions on how to install and get started with the Azure Storage client libraries.

Next steps

For information on samples for other languages: