Skip to main content

deleted_secrets

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

Overview

Namedeleted_secrets
TypeResource
Idazure.key_vault_secrets.deleted_secrets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe secret id.
attributesobjectThe secret management attributes.
contentTypestringThe content type of the secret.
deletedDatestring (date-time)The time when the secret was deleted, in UTC.
kidstringIf this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate.
managedbooleanTrue if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true.
previousVersionstringThe version of the previous certificate, if applicable. Applies only to certificates created after June 1, 2025. Certificates created before this date are not retroactively updated.
recoveryIdstringThe url of the recovery object, used to identify and recover the deleted secret.
scheduledPurgeDatestring (date-time)The time when the secret is scheduled to be purged, in UTC.
tagsobjectApplication specific metadata in the form of key-value pairs.
valuestringThe secret value.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_deleted_secretselectsecret_name, vault_nameGets the specified deleted secret. The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.
get_deleted_secretsselectvault_namemaxresultsLists deleted secrets for the specified vault. The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission.
purge_deleted_secretdeletesecret_name, vault_namePermanently deletes the specified secret. The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge 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
secret_namestringThe name of the secret. Required.
vault_namestringKey vault name. (default: )
maxresultsintegerMaximum number of results to return in a page. If not specified the service will return up to 25 results. Default value is None.

SELECT examples

Gets the specified deleted secret. The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires the secrets/get permission.

SELECT
id,
attributes,
contentType,
deletedDate,
kid,
managed,
previousVersion,
recoveryId,
scheduledPurgeDate,
tags,
value
FROM azure.key_vault_secrets.deleted_secrets
WHERE secret_name = '{{ secret_name }}' -- required
AND vault_name = '{{ vault_name }}' -- required
;

DELETE examples

Permanently deletes the specified secret. The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission.

DELETE FROM azure.key_vault_secrets.deleted_secrets
WHERE secret_name = '{{ secret_name }}' --required
AND vault_name = '{{ vault_name }}' --required
;