Restore-AzKeyVault

Fully restores a managed HSM from backup.

Note

This is the previous version of our documentation. Please consult the most recent version for up-to-date information.

Syntax

Restore-AzKeyVault
       -BackupFolder <String>
       [-KeyName <String>]
       [-PassThru]
       [-HsmName] <String>
       -StorageAccountName <String>
       -StorageContainerName <String>
       -SasToken <SecureString>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Restore-AzKeyVault
       -BackupFolder <String>
       [-KeyName <String>]
       [-PassThru]
       [-HsmName] <String>
       -StorageContainerUri <Uri>
       -SasToken <SecureString>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Restore-AzKeyVault
       -BackupFolder <String>
       [-KeyName <String>]
       [-PassThru]
       -StorageContainerUri <Uri>
       -SasToken <SecureString>
       -HsmObject <PSManagedHsm>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]
Restore-AzKeyVault
       -BackupFolder <String>
       [-KeyName <String>]
       [-PassThru]
       -StorageAccountName <String>
       -StorageContainerName <String>
       -SasToken <SecureString>
       -HsmObject <PSManagedHsm>
       [-DefaultProfile <IAzureContextContainer>]
       [-WhatIf]
       [-Confirm]
       [<CommonParameters>]

Description

Fully restores a managed HSM from a backup stored in a storage account. Use Backup-AzKeyVault to backup.

Examples

Example 1

$sasToken = ConvertTo-SecureString -AsPlainText -Force "?sv=2019-12-12&ss=bfqt&srt=sco&sp=rwdlacupx&se=2020-10-12T14:42:19Z&st=2020-10-12T06:42:19Z&spr=https&sig=******"
Restore-AzKeyVault -HsmName myHsm -StorageContainerUri "https://{accountName}.blob.core.windows.net/{containerName}" -BackupFolder "mhsm-myHsm-2020101308504935" -SasToken $sasToken

The example restores a backup stored in a folder named "mhsm-myHsm-2020101308504935" of a storage container "https://{accountName}.blob.core.windows.net/{containerName}".

Parameters

-BackupFolder

Folder name of the backup, e.g. 'mhsm--2020101309020403'. It can also be nested such as 'backups/mhsm--2020101309020403'.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

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

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HsmName

Name of the HSM.

Type:String
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-HsmObject

Managed HSM object

Type:PSManagedHsm
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-KeyName

Key name to restore.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PassThru

Return true when the HSM is restored.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SasToken

The shared access signature (SAS) token to authenticate the storage account.

Type:SecureString
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StorageAccountName

Name of the storage account where the backup is going to be stored.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StorageContainerName

Name of the blob container where the backup is going to be stored.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StorageContainerUri

URI of the storage container where the backup is going to be stored.

Type:Uri
Position:Named
Default value:None
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:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

Boolean