KeyClient.RotateKey(String, CancellationToken) Method

Definition

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

public virtual Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey> RotateKey (string name, System.Threading.CancellationToken cancellationToken = default);
abstract member RotateKey : string * System.Threading.CancellationToken -> Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>
override this.RotateKey : string * System.Threading.CancellationToken -> Azure.Response<Azure.Security.KeyVault.Keys.KeyVaultKey>
Public Overridable Function RotateKey (name As String, Optional cancellationToken As CancellationToken = Nothing) As 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