< Back

Restore-AzureKeyVaultSecret

Tue Jan 29, 2019 9:50 pm

NAME Restore-AzureKeyVaultSecret



SYNOPSIS

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





SYNTAX

Restore-AzureKeyVaultSecret [-InputObject] <PSKeyVault> [-InputFile] <String> [-DefaultProfile <IAzureContextContainer>] [-Confirm] [-WhatIf]

[<CommonParameters>]



Restore-AzureKeyVaultSecret [-VaultName] <String> [-InputFile] <String> [-DefaultProfile <IAzureContextContainer>] [-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.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InputFile <String>

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



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-InputObject <PSKeyVault>

KeyVault object



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-VaultName <String>

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



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultSecret







NOTES









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.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... aultsecret

Set-AzureKeyVaultSecret

Backup-AzureKeyVaultSecret

Get-AzureKeyVaultSecret

Remove-AzureKeyVaultSecret