Share via


TaskOutputStorage.SaveAsync Method

Definition

Overloads

SaveAsync(TaskOutputKind, String, CancellationToken)

Saves the specified file to persistent storage.

SaveAsync(TaskOutputKind, String, String, CancellationToken)

Saves the specified file to persistent storage.

SaveAsync(TaskOutputKind, String, CancellationToken)

Source:
TaskOutputStorage.cs

Saves the specified file to persistent storage.

public System.Threading.Tasks.Task SaveAsync (Microsoft.Azure.Batch.Conventions.Files.TaskOutputKind kind, string relativePath, System.Threading.CancellationToken cancellationToken = default);
member this.SaveAsync : Microsoft.Azure.Batch.Conventions.Files.TaskOutputKind * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SaveAsync (kind As TaskOutputKind, relativePath As String, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

kind
TaskOutputKind

A TaskOutputKind representing the category under which to store this file, for example TaskOutput or TaskLog.

relativePath
String

The path of the file to save, relative to the current directory. If the file is in a subdirectory of the current directory, the relative path will be preserved in blob storage.

cancellationToken
CancellationToken

A CancellationToken for controlling the lifetime of the asynchronous operation.

Returns

A Task that represents the asynchronous operation.

Exceptions

The kind or relativePath argument is null.

The relativePath argument is an absolute path, or is empty.

Remarks

If the file is outside the current directory, traversals up the directory tree are removed. For example, a relativePath of "..\ProcessEnv.cmd" would be treated as "ProcessEnv.cmd" for the purposes of creating a blob name.

Applies to

SaveAsync(TaskOutputKind, String, String, CancellationToken)

Source:
TaskOutputStorage.cs

Saves the specified file to persistent storage.

public System.Threading.Tasks.Task SaveAsync (Microsoft.Azure.Batch.Conventions.Files.TaskOutputKind kind, string sourcePath, string destinationRelativePath, System.Threading.CancellationToken cancellationToken = default);
member this.SaveAsync : Microsoft.Azure.Batch.Conventions.Files.TaskOutputKind * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SaveAsync (kind As TaskOutputKind, sourcePath As String, destinationRelativePath As String, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

kind
TaskOutputKind

A TaskOutputKind representing the category under which to store this file, for example TaskOutput or TaskLog.

sourcePath
String

The path of the file to save.

destinationRelativePath
String

The blob name under which to save the file. This may include a relative component, such as "pointclouds/pointcloud_0001.txt".

cancellationToken
CancellationToken

A CancellationToken for controlling the lifetime of the asynchronous operation.

Returns

A Task that represents the asynchronous operation.

Exceptions

The kind, sourcePath, or destinationRelativePath argument is null.

The sourcePath or destinationRelativePath argument is empty.

Applies to