Share via


KeyClient.StartRecoverDeletedKeyAsync(String, CancellationToken) Method

Definition

Recovers the deleted key to its latest version.

public virtual System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.RecoverDeletedKeyOperation> StartRecoverDeletedKeyAsync (string name, System.Threading.CancellationToken cancellationToken = default);
abstract member StartRecoverDeletedKeyAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.RecoverDeletedKeyOperation>
override this.StartRecoverDeletedKeyAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Security.KeyVault.Keys.RecoverDeletedKeyOperation>
Public Overridable Function StartRecoverDeletedKeyAsync (name As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of RecoverDeletedKeyOperation)

Parameters

name
String

The name of the key.

cancellationToken
CancellationToken

A CancellationToken controlling the request lifetime.

Returns

A RecoverDeletedKeyOperation to wait on this long-running operation.

Exceptions

name is an empty string.

name is null.

The server returned an error. See Message for details returned from the server.

Remarks

The Recover Deleted Key operation is applicable for deleted keys in soft-delete enabled vaults. It recovers the deleted key back to its latest version under /keys. An attempt to recover an non-deleted key will return an error. Consider this the inverse of the delete operation on soft-delete enabled vaults. This operation requires the keys/recover permission.

Applies to