Επεξεργασία

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


Azure Storage samples using .NET 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 guide for .NET, see Get started with Azure Blob Storage and .NET.

Note

These samples use the latest Azure Storage .NET v12 library. For legacy v11 code, see Azure Blob Storage Samples for .NET in the GitHub repository.

Blob samples

The following table links to Azure Blob Storage developer guides and samples that use .NET client libraries:

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 with Azure Identity

Authenticate using an Active Directory token

Authenticate using a connection string

Authenticate using a shared key credential
Create container Create a container
Upload Upload a blob Upload a file to a blob
Download Download a blob Download a blob to a file

Download an image
List List containers

List blobs
List all blobs in a container
Delete Delete containers

Delete blobs
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
Snapshots Create and manage a blob snapshot
Blob versions Create and list blob versions
Access tiers Set or change a block blob's access tier
Append blob Append data to an append blob
Batching Delete several blobs in one request

Set several blob access tiers in one request

Fine-grained control in a batch request

Catch errors from a failed sub-operation
Troubleshooting Trigger a recoverable error using a container client

Data Lake Storage samples

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

Topic Samples on GitHub
Authentication Authenticate using an Active Directory token
Authenticate using a shared key credential
Authenticate using a shared access signature (SAS)
File system Create a file using a file system client
Get properties on a file and a directory
Rename a file and a directory
Directory Create a directory
Create a file using a directory client
List directories
Traverse files and directories
File Upload a file
Upload by appending to a file
Download a file
Set and get a file access control list
Set and get permissions of a file
Troubleshooting Trigger a recoverable error

Azure File samples

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

Topic Samples on GitHub
Authentication Authenticate using a connection string
Authenticate using a shared key credential
Authenticate using a shared access signature (SAS))
File shares Create a share and upload a file
Download a file
Traverse files and directories
Troubleshooting Authenticate using a shared access signature (SAS))

Queue samples

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

Topic Samples on GitHub
Authentication Authenticate using Microsoft Entra ID
Authenticate using a connection string
Authenticate using a shared key credential
Authenticate using a shared access signature (SAS))
Authenticate using an Active Directory token
Queue Create a queue and add a message
Message Receive and process messages
Peek at messages
Receive messages and update visibility timeout
Troubleshooting Trigger a recoverable error using a queue client

Table samples

The following list links to Azure Table Storage samples that use .NET client libraries:

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

Azure code sample libraries

To view the complete .NET sample libraries, go to:

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

Getting started guides

See the following articles for instructions on how to install and get started with the Azure Storage client libraries.

Next steps

For information on samples for other languages: