Backup-AzKeyVault

Fully backup a managed HSM.

Note

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

Syntax

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

Description

Fully backup a managed HSM to a storage account. Use Restore-AzKeyVault to restore the 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=******"

Backup-AzKeyVault -HsmName myHsm -StorageContainerUri "https://{accountName}.blob.core.windows.net/{containerName}" -SasToken $sasToken

https://{accountName}.blob.core.windows.net/{containerName}/{backupFolder}

The cmdlet will create a folder (typically named mhsm-{name}-{timestamp}) in the storage container, store the backup in that folder and output the folder URI.

Parameters

-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
-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

String