Recover Deleted Secret - Recover Deleted Secret

Recovers the deleted secret to the latest version.
Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. This operation requires the secrets/recover permission.

POST {vaultBaseUrl}/deletedsecrets/{secret-name}/recover?api-version=7.4

URI Parameters

Name In Required Type Description
secret-name
path True

string

The name of the deleted secret.

vaultBaseUrl
path True

string

The vault name, for example https://myvault.vault.azure.net.

api-version
query True

string

Client API version.

Responses

Name Type Description
200 OK

SecretBundle

A Secret bundle of the original secret and its attributes.

Other Status Codes

KeyVaultError

Key Vault error response describing why the operation failed.

Examples

RecoverDeletedSecret

Sample Request

POST https://myvault.vault.azure.net//deletedsecrets/SecretCreateDeleteRecoverPurgeTest/recover?api-version=7.4

Sample Response

{
  "id": "https://myvault.vault.azure.net/secrets/SecretCreateDeleteRecoverPurgeTest/16f5f7feb7004280b7f3b8ac50cd01f9",
  "attributes": {
    "enabled": true,
    "created": 1493937960,
    "updated": 1493937960,
    "recoveryLevel": "Recoverable+Purgeable"
  }
}

Definitions

Name Description
DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval.

Error

The key vault server error.

KeyVaultError

The key vault error exception.

SecretAttributes

The secret management attributes.

SecretBundle

A secret consisting of a value, id and its attributes.

DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval.

Name Type Description
CustomizedRecoverable

string

Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90).This level guarantees the recoverability of the deleted entity during the retention interval and while the subscription is still available.

CustomizedRecoverable+ProtectedSubscription

string

Denotes a vault and subscription state in which deletion is recoverable, immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled when 7<= SoftDeleteRetentionInDays < 90. This level guarantees the recoverability of the deleted entity during the retention interval, and also reflects the fact that the subscription itself cannot be cancelled.

CustomizedRecoverable+Purgeable

string

Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge when 7<= SoftDeleteRetentionInDays < 90). This level guarantees the recoverability of the deleted entity during the retention interval, unless a Purge operation is requested, or the subscription is cancelled.

Purgeable

string

Denotes a vault state in which deletion is an irreversible operation, without the possibility for recovery. This level corresponds to no protection being available against a Delete operation; the data is irretrievably lost upon accepting a Delete operation at the entity level or higher (vault, resource group, subscription etc.)

Recoverable

string

Denotes a vault state in which deletion is recoverable without the possibility for immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval(90 days) and while the subscription is still available. System wil permanently delete it after 90 days, if not recovered

Recoverable+ProtectedSubscription

string

Denotes a vault and subscription state in which deletion is recoverable within retention interval (90 days), immediate and permanent deletion (i.e. purge) is not permitted, and in which the subscription itself cannot be permanently canceled. System wil permanently delete it after 90 days, if not recovered

Recoverable+Purgeable

string

Denotes a vault state in which deletion is recoverable, and which also permits immediate and permanent deletion (i.e. purge). This level guarantees the recoverability of the deleted entity during the retention interval (90 days), unless a Purge operation is requested, or the subscription is cancelled. System wil permanently delete it after 90 days, if not recovered

Error

The key vault server error.

Name Type Description
code

string

The error code.

innererror

Error

The key vault server error.

message

string

The error message.

KeyVaultError

The key vault error exception.

Name Type Description
error

Error

The key vault server error.

SecretAttributes

The secret management attributes.

Name Type Description
created

integer

Creation time in UTC.

enabled

boolean

Determines whether the object is enabled.

exp

integer

Expiry date in UTC.

nbf

integer

Not before date in UTC.

recoverableDays

integer

softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0.

recoveryLevel

DeletionRecoveryLevel

Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end of the retention interval.

updated

integer

Last updated time in UTC.

SecretBundle

A secret consisting of a value, id and its attributes.

Name Type Description
attributes

SecretAttributes

The secret management attributes.

contentType

string

The content type of the secret.

id

string

The secret id.

kid

string

If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate.

managed

boolean

True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be true.

tags

object

Application specific metadata in the form of key-value pairs.

value

string

The secret value.