AgentAdministrationClient.DownloadAgentCode Method

Definition

Download the code zip for the latest version of a code-based hosted agent. And unpacks ut to the user directory; returns the zip content as a binary data. Returns the previously-uploaded zip (application/zip). The SHA-256 digest of the returned bytes matches the content_hash on the latest version's code_configuration.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual BinaryData DownloadAgentCode(string agentName, string path, System.Threading.CancellationToken cancellationToken = default);
abstract member DownloadAgentCode : string * string * System.Threading.CancellationToken -> BinaryData
override this.DownloadAgentCode : string * string * System.Threading.CancellationToken -> BinaryData
Public Overridable Function DownloadAgentCode (agentName As String, path As String, Optional cancellationToken As CancellationToken = Nothing) As BinaryData

Parameters

agentName
String

The name of the agent whose latest-version code zip should be downloaded.

path
String

The path to save the agent code.

cancellationToken
CancellationToken

The cancellation token that can be used to cancel the operation.

Returns

The response returned from the service.

Exceptions

agentName or path is null.

agentName or path is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Applies to