Share via


BlobContainerClientExtensions.UploadDirectoryAsync Method

Definition

Overloads

UploadDirectoryAsync(BlobContainerClient, WaitUntil, String, BlobContainerClientTransferOptions, CancellationToken)

Uploads the entire contents of local directory to the blob container.

UploadDirectoryAsync(BlobContainerClient, WaitUntil, String, String, CancellationToken)

Uploads the entire contents of local directory to the blob container.

UploadDirectoryAsync(BlobContainerClient, WaitUntil, String, BlobContainerClientTransferOptions, CancellationToken)

Source:
BlobContainerClientExtensions.cs

Uploads the entire contents of local directory to the blob container.

public static System.Threading.Tasks.Task<Azure.Storage.DataMovement.TransferOperation> UploadDirectoryAsync (this Azure.Storage.Blobs.BlobContainerClient client, Azure.WaitUntil waitUntil, string localDirectoryPath, Azure.Storage.DataMovement.Blobs.BlobContainerClientTransferOptions options, System.Threading.CancellationToken cancellationToken = default);
static member UploadDirectoryAsync : Azure.Storage.Blobs.BlobContainerClient * Azure.WaitUntil * string * Azure.Storage.DataMovement.Blobs.BlobContainerClientTransferOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Storage.DataMovement.TransferOperation>
<Extension()>
Public Function UploadDirectoryAsync (client As BlobContainerClient, waitUntil As WaitUntil, localDirectoryPath As String, options As BlobContainerClientTransferOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TransferOperation)

Parameters

client
BlobContainerClient

The BlobContainerClient used for service operations.

waitUntil
WaitUntil

Indicates whether this invocation should wait until the transfer is complete to return or return immediately.

localDirectoryPath
String

The full path to the local directory to be uploaded.

options
BlobContainerClientTransferOptions

Options which control the directory upload.

cancellationToken
CancellationToken

Cancels starting the operation or if waitUntil is set to Completed, cancels waiting for the operation. Cancelling this token does not cancel the operation itself.

Returns

A TransferOperation instance which contains information about the transfer and its status.

Remarks

This is an async long-running operation which means the operation may not be complete when this methods returns. If waitUntil is set to Started, the method will return as soon as a transfer is started and WaitForCompletionAsync(CancellationToken) can be used to wait for the transfer to complete. If waitUntil is set to Completed, the method will wait for the entire transfer to complete. In either case, the caller must check the status of the transfer using the returned TransferOperation instance to determine if the transfer completed successfully or not. This method will not throw an exception if the transfer fails, but the Status will indicate a failure.

Applies to

UploadDirectoryAsync(BlobContainerClient, WaitUntil, String, String, CancellationToken)

Source:
BlobContainerClientExtensions.cs

Uploads the entire contents of local directory to the blob container.

public static System.Threading.Tasks.Task<Azure.Storage.DataMovement.TransferOperation> UploadDirectoryAsync (this Azure.Storage.Blobs.BlobContainerClient client, Azure.WaitUntil waitUntil, string localDirectoryPath, string blobDirectoryPrefix = default, System.Threading.CancellationToken cancellationToken = default);
static member UploadDirectoryAsync : Azure.Storage.Blobs.BlobContainerClient * Azure.WaitUntil * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Storage.DataMovement.TransferOperation>
<Extension()>
Public Function UploadDirectoryAsync (client As BlobContainerClient, waitUntil As WaitUntil, localDirectoryPath As String, Optional blobDirectoryPrefix As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TransferOperation)

Parameters

client
BlobContainerClient

The BlobContainerClient used for service operations.

waitUntil
WaitUntil

Indicates whether this invocation should wait until the transfer is complete to return or return immediately.

localDirectoryPath
String

The full path to the local directory to be uploaded.

blobDirectoryPrefix
String

Optionally specifies the directory prefix to be prepended to all uploaded files.

cancellationToken
CancellationToken

Cancels starting the operation or if waitUntil is set to Completed, cancels waiting for the operation. Cancelling this token does not cancel the operation itself.

Returns

A TransferOperation instance which contains information about the transfer and its status.

Remarks

This is an async long-running operation which means the operation may not be complete when this methods returns. If waitUntil is set to Started, the method will return as soon as a transfer is started and WaitForCompletionAsync(CancellationToken) can be used to wait for the transfer to complete. If waitUntil is set to Completed, the method will wait for the entire transfer to complete. In either case, the caller must check the status of the transfer using the returned TransferOperation instance to determine if the transfer completed successfully or not. This method will not throw an exception if the transfer fails, but the Status will indicate a failure.

Applies to