@azure/keyvault-secrets package

Classes

SecretClient

The SecretClient provides methods to manage <xref:KeyVaultSecret> in the Azure Key Vault. The client supports creating, retrieving, updating, deleting, purging, backing up, restoring and listing KeyVaultSecrets. The client also supports listing <xref:DeletedSecret> for a soft-delete enabled Azure Key Vault.

Interfaces

BackupSecretOptions

Options for <xref:backupSecretOptions>.

BeginDeleteSecretOptions

An interface representing the optional parameters that can be passed to <xref:beginDeleteSecret>

BeginRecoverDeletedSecretOptions

An interface representing the optional parameters that can be passed to <xref:beginRecoverDeletedSecret>

DeletedSecret

An interface representing a deleted KeyVault Secret.

GetDeletedSecretOptions

Options for <xref:getDeletedSecret>.

GetSecretOptions

Options for <xref:getSecret>.

KeyVaultSecret

An interface representing a KeyVault Secret, with its name, value and <xref:SecretProperties>.

KeyVaultSecretIdentifier

Represents the segments that compose a Key Vault Secret Id.

ListDeletedSecretsOptions

Options for <xref:listDeletedSecrets>.

ListPropertiesOfSecretVersionsOptions

Options for <xref:listPropertiesOfSecretVersions>.

ListPropertiesOfSecretsOptions

Options for <xref:listPropertiesOfSecrets>.

PurgeDeletedSecretOptions

Options for <xref:purgeDeletedSecret>.

RestoreSecretBackupOptions

Options for <xref:restoreSecretBackup>.

SecretClientOptions

The optional parameters accepted by the KeyVault's KeyClient

SecretPollerOptions

An interface representing the optional parameters that can be passed to <xref:beginDeleteSecret> and <xref:beginRecoverDeletedKey>.

SecretProperties

An interface representing the properties of a <xref:KeyVaultSecret>.

SetSecretOptions

Options for <xref:setSecret>.

UpdateSecretPropertiesOptions

Options for <xref:updateSecretProperties>.

Type Aliases

DeletionRecoveryLevel

Defines values for DeletionRecoveryLevel.
<xref:KnownDeletionRecoveryLevel> can be used interchangeably with DeletionRecoveryLevel, this enum contains the known values that the service supports.

Know values supported by the service

Purgeable: 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+Purgeable: 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
Recoverable: 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: 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
CustomizedRecoverable+Purgeable: 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.
CustomizedRecoverable: 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: 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.

Enums

KnownDeletionRecoveryLevel

Known values of <xref:DeletionRecoveryLevel> that the service accepts.

Functions

parseKeyVaultSecretIdentifier(string)

Parses the given Key Vault Secret Id. An example is: https://.vault.azure.net/secrets//

On parsing the above Id, this function returns:

  {
     sourceId: "https://<keyvault-name>.vault.azure.net/secrets/<secret-name>/<unique-version-id>",
     vaultUrl: "https://<keyvault-name>.vault.azure.net",
     version: "<unique-version-id>",
     name: "<secret-name>"
  }

Function Details

parseKeyVaultSecretIdentifier(string)

Parses the given Key Vault Secret Id. An example is: https://.vault.azure.net/secrets//

On parsing the above Id, this function returns:

  {
     sourceId: "https://<keyvault-name>.vault.azure.net/secrets/<secret-name>/<unique-version-id>",
     vaultUrl: "https://<keyvault-name>.vault.azure.net",
     version: "<unique-version-id>",
     name: "<secret-name>"
  }
function parseKeyVaultSecretIdentifier(id: string)

Parameters

id

string

The Id of the Key Vault Secret.

Returns