Skip to main content

key_rotation_policies

Creates, updates, deletes, gets or lists a key_rotation_policies resource.

Overview

Namekey_rotation_policies
TypeResource
Idazure.key_vault_keys.key_rotation_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe key policy id.
attributesobjectThe key rotation policy attributes.
lifetimeActionsarrayActions that will be performed by Key Vault over the lifetime of a key. For preview, lifetimeActions can only have two items at maximum: one for rotate, one for notify. Notification time would be default to 30 days before expiry and it is not configurable.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_key_rotation_policyselectkey_name, vault_nameLists the policy for a key. The GetKeyRotationPolicy operation returns the specified key policy resources in the specified key vault. This operation requires the keys/get permission.
update_key_rotation_policyupdatekey_name, vault_nameUpdates the rotation policy for a key. Set specified members in the key policy. Leave others as undefined. This operation requires the keys/update permission.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
key_namestringThe name of the key in the given vault. Required.
vault_namestringKey vault name. (default: )

SELECT examples

Lists the policy for a key. The GetKeyRotationPolicy operation returns the specified key policy resources in the specified key vault. This operation requires the keys/get permission.

SELECT
id,
attributes,
lifetimeActions
FROM azure.key_vault_keys.key_rotation_policies
WHERE key_name = '{{ key_name }}' -- required
AND vault_name = '{{ vault_name }}' -- required
;

UPDATE examples

Updates the rotation policy for a key. Set specified members in the key policy. Leave others as undefined. This operation requires the keys/update permission.

UPDATE azure.key_vault_keys.key_rotation_policies
SET
lifetimeActions = '{{ lifetimeActions }}',
attributes = '{{ attributes }}'
WHERE
key_name = '{{ key_name }}' --required
AND vault_name = '{{ vault_name }}' --required
RETURNING
id,
attributes,
lifetimeActions;