You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/blobs/storage-blob-download.md
+31-2Lines changed: 31 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ services: storage
6
6
author: pauljewellmsft
7
7
8
8
ms.author: pauljewell
9
-
ms.date: 04/21/2023
9
+
ms.date: 05/23/2023
10
10
ms.service: storage
11
11
ms.subservice: blobs
12
12
ms.topic: how-to
@@ -23,7 +23,7 @@ This article shows how to download a blob using the [Azure Storage client librar
23
23
To work with the code examples in this article, make sure you have:
24
24
25
25
- An authorized client object to connect to Blob Storage data resources. To learn more, see [Create and manage client objects that interact with data resources](storage-blob-client-management.md).
26
-
- Permissions to perform an upload operation. To learn more, see the authorization guidance for the following REST API operation:
26
+
- Permissions to perform a download operation. To learn more, see the authorization guidance for the following REST API operation:
- The package **Azure.Storage.Blobs** installed to your project directory. To learn more about setting up your project, see [Get Started with Azure Storage and .NET](storage-blob-dotnet-get-started.md#set-up-your-project).
29
29
@@ -65,6 +65,35 @@ The following example downloads a blob by reading from a stream:
## Download a block blob with configuration options
69
+
70
+
You can define client library configuration options when downloading a blob. These options can be tuned to improve performance and enhance reliability. The following code examples show how to use [BlobDownloadToOptions](/dotnet/api/azure.storage.blobs.models.blobdownloadtooptions) to define configuration options when calling an download method. Note that the same options are available for [BlobDownloadOptions](/dotnet/api/azure.storage.blobs.models.blobdownloadoptions).
71
+
72
+
### Specify data transfer options on download
73
+
74
+
You can configure the values in [StorageTransferOptions](/dotnet/api/azure.storage.storagetransferoptions) to improve performance for data transfer operations. The following code example shows how to set values for `StorageTransferOptions` and include the options as part of a `BlobDownloadToOptions` instance. The values provided in this sample aren't intended to be a recommendation. To properly tune these values, you need to consider the specific needs of your app.
To learn more about tuning data transfer options, see [Performance tuning for uploads and downloads](storage-blobs-tune-upload-download.md).
79
+
80
+
### Specify transfer validation options on download
81
+
82
+
You can specify transfer validation options to help ensure that data is downloaded properly and hasn't been tampered with during transit. Transfer validation options can be defined at the client level using [BlobClientOptions](/dotnet/api/azure.storage.blobs.blobclientoptions), which applies validation options to all methods called from a [BlobClient](/dotnet/api/azure.storage.blobs.blobclient) instance.
83
+
84
+
You can also override transfer validation options at the method level using [BlobDownloadToOptions](/dotnet/api/azure.storage.blobs.models.blobdownloadtooptions). The following code example shows how to create a `BlobDownloadToOptions` object and specify an algorithm for generating a checksum. The checksum is then used by the service to verify data integrity of the downloaded content.
The following table shows the available options for the checksum algorithm, as defined by [StorageChecksumAlgorithm](/dotnet/api/azure.storage.storagechecksumalgorithm):
89
+
90
+
| Name | Value | Description |
91
+
| --- | --- | --- |
92
+
| Auto | 0 | Recommended. Allows the library to choose an algorithm. Different library versions may choose different algorithms. |
93
+
| None | 1 | No selected algorithm. Don't calculate or request checksums.
0 commit comments