Restore-​Azure​Key​Vault​Secret

Creates a secret in a key vault from a backed-up secret.

Syntax

Restore-AzureKeyVaultSecret
       [-VaultName] <String>
       [-InputFile] <String>
       [-Confirm]
       [-WhatIf]
       [<CommonParameters>]

Description

The Restore-AzureKeyVaultSecret cmdlet creates a secret in the specified key vault. This secret is a replica of the backed-up secret in the input file and has the same name as the original secret. If the key vault already has a secret by the same name, this cmdlet fails instead of overwriting the original secret. If the backup contains multiple versions of a secret, all versions are restored.

The key vault that you restore the secret into can be different from the key vault that you backed up the secret from. However, the key vault must use the same subscription and be in an Azure region in the same geography (for example, North America). See the Microsoft Azure Trust Center (https://azure.microsoft.com/support/trust-center/) for the mapping of Azure regions to geographies.

Examples

Example 1: Restore a backed-up secret

PS C:\>Restore-AzureKeyVaultSecret -VaultName 'MyKeyVault' -InputFile "C:\Backup.blob"

This command restores a secret, including all of its versions, from the backup file named Backup.blob into the key vault named MyKeyVault.

Required Parameters

-InputFile

Specifies the input file that contains the backup of the secret to restore.

Type:String
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VaultName

Specifies the name of the key vault into which to restore the secret.

Type:String
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False