Sdílet prostřednictvím


ClientEncryptionKey.ReadAsync(RequestOptions, CancellationToken) Method

Definition

Reads the properties of a client encryption key from the Azure Cosmos service as an asynchronous operation. This method is not meant to be invoked directly. Please see https://aka.ms/CosmosClientEncryption in order to use client-side encryption.

public abstract System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ClientEncryptionKeyResponse> ReadAsync (Microsoft.Azure.Cosmos.RequestOptions requestOptions = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ReadAsync : Microsoft.Azure.Cosmos.RequestOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Cosmos.ClientEncryptionKeyResponse>
Public MustOverride Function ReadAsync (Optional requestOptions As RequestOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ClientEncryptionKeyResponse)

Parameters

requestOptions
RequestOptions

(Optional) The options for the request.

cancellationToken
CancellationToken

(Optional) Token representing request cancellation.

Returns

An awaitable response which wraps a ClientEncryptionKeyProperties containing details of the client encryption key that was read.

Exceptions

This exception can encapsulate many different types of errors. To determine the specific error always look at the StatusCode property. Some common codes you may get when reading a client encryption key are:

StatusCodeReason for exception
404 NotFound - This means the resource or parent resource you tried to read did not exist.
429 TooManyRequests - This means you have exceeded the number of request units per second. Consult the CosmosException.RetryAfter value to see how long you should wait before retrying this operation.

Applies to