AgentAdministrationClient.DownloadAgentCodeAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Download the code zip for the latest version of a code-based hosted agent and unpacks it 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 System.Threading.Tasks.Task<BinaryData> DownloadAgentCodeAsync(string agentName, string path, System.Threading.CancellationToken cancellationToken = default);
abstract member DownloadAgentCodeAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
override this.DownloadAgentCodeAsync : string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<BinaryData>
Public Overridable Function DownloadAgentCodeAsync (agentName As String, path As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of 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.