Share via


KeyClient.RotateKeyAsync(String, CancellationToken) Method

Definition

Creates a new key version in Key Vault, stores it, then returns the new KeyVaultKey.

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

Parameters

name
String

The name of key to be rotated. The system will generate a new version in the specified key.

cancellationToken
CancellationToken

A CancellationToken controlling the request lifetime.

Returns

A new version of the rotate KeyVaultKey.

Exceptions

name contains an empty string.

name is null.

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

Remarks

The operation will rotate the key based on the key policy. It requires the keys/rotate permission.

Applies to